OSDN Git Service

Added recognition for signed add/sub/mul with overflow intrinsics to GVN as per Chris...
authorLang Hames <lhames@gmail.com>
Sat, 9 Jul 2011 00:25:11 +0000 (00:25 +0000)
committerLang Hames <lhames@gmail.com>
Sat, 9 Jul 2011 00:25:11 +0000 (00:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134777 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/GVN.cpp

index e6bc77f..87b7317 100644 (file)
@@ -173,12 +173,15 @@ Expression ValueTable::create_extractvalue_expression(ExtractValueInst *EI) {
     // is we'll synthesize a semantically equivalent expression instead on
     // an extract value expression.
     switch (I->getIntrinsicID()) {
+      case Intrinsic::sadd_with_overflow:
       case Intrinsic::uadd_with_overflow:
         e.opcode = Instruction::Add;
         break;
+      case Intrinsic::ssub_with_overflow:
       case Intrinsic::usub_with_overflow:
         e.opcode = Instruction::Sub;
         break;
+      case Intrinsic::smul_with_overflow:
       case Intrinsic::umul_with_overflow:
         e.opcode = Instruction::Mul;
         break;