Added recognition for signed add/sub/mul with overflow intrinsics to GVN as per Chris and Frits suggestion.

llvm-svn: 134777
This commit is contained in:
Lang Hames 2011-07-09 00:25:11 +00:00
parent bf6afec312
commit 266dab7bab
1 changed files with 3 additions and 0 deletions

View 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;