llvm-6502/lib/Transforms/InstCombine
Evan Cheng 79590b8edf Instcombine was transforming:
%shr = lshr i64 %key, 3
  %0 = load i64* %val, align 8
  %sub = add i64 %0, -1
  %and = and i64 %sub, %shr
  ret i64 %and

to:
  %shr = lshr i64 %key, 3
  %0 = load i64* %val, align 8
  %sub = add i64 %0, 2305843009213693951
  %and = and i64 %sub, %shr
  ret i64 %and

The demanded bit optimization is actually a pessimization because add -1 would
be codegen'ed as a sub 1. Teach the demanded constant shrinking optimization
to check for negated constant to make sure it is actually reducing the width
of the constant.

rdar://11793464


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160101 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-12 01:45:35 +00:00
..
CMakeLists.txt llvm/lib: [CMake] Add explicit dependency to intrinsics_gen. 2012-06-24 13:32:01 +00:00
InstCombine.h instcombine: merge the functions that remove dead allocas and dead mallocs/callocs/... 2012-07-09 18:38:20 +00:00
InstCombineAddSub.cpp Remove a instcombine transform that (no longer?) makes sense: 2012-06-26 22:03:13 +00:00
InstCombineAndOrXor.cpp InstCombine: fix a bug when combining (fcmp cc0 x, y) && (fcmp cc1 x, y). 2012-06-14 05:57:42 +00:00
InstCombineCalls.cpp instcombine: merge the functions that remove dead allocas and dead mallocs/callocs/... 2012-07-09 18:38:20 +00:00
InstCombineCasts.cpp Revert remaining part of r93200: "Disable folding sext(trunc(x)) -> x" 2012-06-22 16:36:43 +00:00
InstCombineCompares.cpp InstCombine: factor code better. 2012-06-11 08:01:25 +00:00
InstCombineLoadStoreAlloca.cpp instcombine: merge the functions that remove dead allocas and dead mallocs/callocs/... 2012-07-09 18:38:20 +00:00
InstCombineMulDivRem.cpp Look pass zext to strength reduce an udiv. Patch by David Majnemer. rdar://11721329 2012-06-21 22:52:49 +00:00
InstCombinePHI.cpp
InstCombineSelect.cpp Fix a bug in FoldSelectOpOp. Bitcast ops may change the number of vector elements, which may disagree with the select condition type. 2012-06-07 20:28:57 +00:00
InstCombineShifts.cpp PR12967: Don't crash when trying to fold a shift that's larger than the type's size. 2012-05-27 22:03:32 +00:00
InstCombineSimplifyDemanded.cpp Instcombine was transforming: 2012-07-12 01:45:35 +00:00
InstCombineVectorOps.cpp
InstCombineWorklist.h
InstructionCombining.cpp instcombine: merge the functions that remove dead allocas and dead mallocs/callocs/... 2012-07-09 18:38:20 +00:00
LLVMBuild.txt
Makefile