Teach GVN to not assert on vector comparisons
authorNate Begeman <natebegeman@mac.com>
Sun, 18 May 2008 19:49:05 +0000 (19:49 +0000)
committerNate Begeman <natebegeman@mac.com>
Sun, 18 May 2008 19:49:05 +0000 (19:49 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51230 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/GVN.cpp

index c671078587fcd79120f4ae134e57c6bd8d67a803..3af6c2022baa2e826e12e93079552a7bf3b80ea9 100644 (file)
@@ -226,7 +226,7 @@ Expression::ExpressionOpcode ValueTable::getOpcode(BinaryOperator* BO) {
 }
 
 Expression::ExpressionOpcode ValueTable::getOpcode(CmpInst* C) {
-  if (isa<ICmpInst>(C)) {
+  if (isa<ICmpInst>(C) || isa<VICmpInst>(C)) {
     switch (C->getPredicate()) {
     default:  // THIS SHOULD NEVER HAPPEN
       assert(0 && "Comparison with unknown predicate?");
@@ -242,7 +242,7 @@ Expression::ExpressionOpcode ValueTable::getOpcode(CmpInst* C) {
     case ICmpInst::ICMP_SLE: return Expression::ICMPSLE;
     }
   }
-  assert(isa<FCmpInst>(C) && "Unknown compare");
+  assert((isa<FCmpInst>(C) || isa<VFCmpInst>(C)) && "Unknown compare");
   switch (C->getPredicate()) {
   default: // THIS SHOULD NEVER HAPPEN
     assert(0 && "Comparison with unknown predicate?");