diff options
| author | Lang Hames <lhames@gmail.com> | 2011-07-09 00:25:11 +0000 |
|---|---|---|
| committer | Lang Hames <lhames@gmail.com> | 2011-07-09 00:25:11 +0000 |
| commit | 266dab7babdeee849cbac88e9971428580f88b3b (patch) | |
| tree | b18caa39b30ff32fc8ad315bec4140bb4b770f64 /llvm/lib/Transforms/Scalar | |
| parent | bf6afec312b0229dae060f7b3a34e0cfa7574a3a (diff) | |
| download | bcm5719-llvm-266dab7babdeee849cbac88e9971428580f88b3b.tar.gz bcm5719-llvm-266dab7babdeee849cbac88e9971428580f88b3b.zip | |
Added recognition for signed add/sub/mul with overflow intrinsics to GVN as per Chris and Frits suggestion.
llvm-svn: 134777
Diffstat (limited to 'llvm/lib/Transforms/Scalar')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/GVN.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/GVN.cpp b/llvm/lib/Transforms/Scalar/GVN.cpp index e6bc77fb8ef..87b7317ad2d 100644 --- a/llvm/lib/Transforms/Scalar/GVN.cpp +++ b/llvm/lib/Transforms/Scalar/GVN.cpp @@ -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; |

