1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00
llvm-mirror/lib/Transforms/InstCombine
David Majnemer 10db94fa84 InstCombine: FoldGEPICmp shouldn't change sign of base pointer comparison
Changing the sign when comparing the base pointer would introduce all
sorts of unexpected things like:
  %gep.i = getelementptr inbounds [1 x i8]* %a, i32 0, i32 0
  %gep2.i = getelementptr inbounds [1 x i8]* %b, i32 0, i32 0
  %cmp.i = icmp ult i8* %gep.i, %gep2.i
  %cmp.i1 = icmp ult [1 x i8]* %a, %b
  %cmp = icmp ne i1 %cmp.i, %cmp.i1
  ret i1 %cmp

into:
  %cmp.i = icmp slt [1 x i8]* %a, %b
  %cmp.i1 = icmp ult [1 x i8]* %a, %b
  %cmp = xor i1 %cmp.i, %cmp.i1
  ret i1 %cmp

By preserving the original sign, we now get:
  ret i1 false

This fixes PR16483.

llvm-svn: 185259
2013-06-29 10:28:04 +00:00
..
CMakeLists.txt Tidy up a bit. No functional change. 2013-04-05 21:20:12 +00:00
InstCombine.h Reapply with r182909 with a fix to the calculation of the new indices for 2013-05-31 00:59:42 +00:00
InstCombineAddSub.cpp In InstCombine{AddSub,MulDivRem} convert APFloat.isFiniteNonZero() && !APFloat.isDenormal => APFloat.isNormal. 2013-06-26 23:17:31 +00:00
InstCombineAndOrXor.cpp Remove unneeded cast<>. 2013-06-06 00:49:57 +00:00
InstCombineCalls.cpp Fix using arg_end() - arg_begin() instead of arg_size() 2013-06-28 00:25:40 +00:00
InstCombineCasts.cpp InstCombine: Don't claim to be able to evaluate any shl in a zexted type. 2013-05-10 16:26:37 +00:00
InstCombineCompares.cpp InstCombine: FoldGEPICmp shouldn't change sign of base pointer comparison 2013-06-29 10:28:04 +00:00
InstCombineLoadStoreAlloca.cpp Tidy up a bit. No functional change. 2013-04-05 21:20:12 +00:00
InstCombineMulDivRem.cpp InstCombine: Be more agressive optimizing 'udiv' instrs with 'select' denoms 2013-06-29 08:40:07 +00:00
InstCombinePHI.cpp Tidy up a bit. No functional change. 2013-04-05 21:20:12 +00:00
InstCombineSelect.cpp Revert r164763 because it introduces new shuffles. 2013-05-06 02:39:09 +00:00
InstCombineShifts.cpp Revert r174152. The shift amount may overflow and in that case this transformation is illegal. 2013-02-01 07:59:33 +00:00
InstCombineSimplifyDemanded.cpp InstCombine: Don't just copy known bits from the first operand of an srem. 2013-05-09 16:32:32 +00:00
InstCombineVectorOps.cpp Delete dead safety check. 2013-06-03 23:15:20 +00:00
InstCombineWorklist.h Remove trailing spaces. 2013-01-14 23:16:36 +00:00
InstructionCombining.cpp Add ArrayRef constructor from None, and do the cleanups that this constructor enables 2013-05-05 00:40:33 +00:00
LLVMBuild.txt
Makefile