summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit91386800eaa94eb2048d631eab95cb7327a8e553 (patch)
tree686e7981c3e7e2147503159200b038bf11262549 /llvm/lib/VMCore/Instruction.cpp
parent1ddbd94a7bdb80acbfb4412ac5b34a4531fb1a2f (diff)
downloadbcm5719-llvm-91386800eaa94eb2048d631eab95cb7327a8e553.tar.gz
bcm5719-llvm-91386800eaa94eb2048d631eab95cb7327a8e553.zip
Fix Transforms/InstCombine/2006-10-26-VectorReassoc.ll
llvm-svn: 31200
Diffstat (limited to 'llvm/lib/VMCore/Instruction.cpp')
-rw-r--r--llvm/lib/VMCore/Instruction.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/VMCore/Instruction.cpp b/llvm/lib/VMCore/Instruction.cpp
index c5e8e303545..9b5fa714ea0 100644
--- a/llvm/lib/VMCore/Instruction.cpp
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud