[llvm-commits] CVS: llvm/lib/VMCore/Instruction.cpp
Chris Lattner
sabre at nondot.org
Thu Oct 26 11:27:41 PDT 2006
Changes in directory llvm/lib/VMCore:
Instruction.cpp updated: 1.54 -> 1.55
---
Log message:
Fix Transforms/InstCombine/2006-10-26-VectorReassoc.ll
---
Diffs of the changes: (+6 -5)
Instruction.cpp | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
Index: llvm/lib/VMCore/Instruction.cpp
diff -u llvm/lib/VMCore/Instruction.cpp:1.54 llvm/lib/VMCore/Instruction.cpp:1.55
--- llvm/lib/VMCore/Instruction.cpp:1.54 Thu Oct 26 01:15:43 2006
+++ llvm/lib/VMCore/Instruction.cpp Thu Oct 26 13:27:26 2006
@@ -172,11 +172,12 @@
/// 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;
}
More information about the llvm-commits
mailing list