summaryrefslogtreecommitdiff
path: root/lib/VMCore/Instruction.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-10-26 18:27:26 +0000
committerChris Lattner <sabre@nondot.org>2006-10-26 18:27:26 +0000
commit4d3839ded2f434c67bc5f5cc7803978a727defb3 (patch)
tree63d5763597b4d3c9852d8328e405ddf6c9187305 /lib/VMCore/Instruction.cpp
parent9290885e6a20c55395aedc15a97fa2a2a692ba13 (diff)
downloadllvm-4d3839ded2f434c67bc5f5cc7803978a727defb3.tar.gz
llvm-4d3839ded2f434c67bc5f5cc7803978a727defb3.tar.bz2
llvm-4d3839ded2f434c67bc5f5cc7803978a727defb3.tar.xz
Fix Transforms/InstCombine/2006-10-26-VectorReassoc.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31200 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Instruction.cpp')
-rw-r--r--lib/VMCore/Instruction.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/VMCore/Instruction.cpp b/lib/VMCore/Instruction.cpp
index c5e8e30354..9b5fa714ea 100644
--- a/lib/VMCore/Instruction.cpp
+++ b/lib/VMCore/Instruction.cpp
@@ -172,11 +172,12 @@ bool Instruction::isIdenticalTo(Instruction *I) const {
/// applied to floating point types.
///
bool Instruction::isAssociative(unsigned Opcode, const Type *Ty) {
- if (Opcode == Add || Opcode == Mul ||
- Opcode == And || Opcode == Or || Opcode == Xor) {
- // Floating point operations do not associate!
- return !Ty->isFloatingPoint();
- }
+ if (Opcode == And || Opcode == Or || Opcode == Xor)
+ return true;
+
+ // Add/Mul reassociate unless they are FP or FP vectors.
+ if (Opcode == Add || Opcode == Mul)
+ return !Ty->isFPOrFPVector();
return 0;
}