llvm-6502/lib/Transforms/InstCombine
Evan Cheng bbbe413846 Remove a instcombine transform that (no longer?) makes sense:
// C - zext(bool) -> bool ? C - 1 : C
    if (ZExtInst *ZI = dyn_cast<ZExtInst>(Op1))
      if (ZI->getSrcTy()->isIntegerTy(1))
        return SelectInst::Create(ZI->getOperand(0), SubOne(C), C);

This ends up forming sext i1 instructions that codegen to terrible code. e.g.
int blah(_Bool x, _Bool y) {
  return (x - y) + 1;
}
=>
        movzbl  %dil, %eax
        movzbl  %sil, %ecx
        shll    $31, %ecx
        sarl    $31, %ecx
        leal    1(%rax,%rcx), %eax
        ret


Without the rule, llvm now generates:
        movzbl  %sil, %ecx
        movzbl  %dil, %eax
        incl    %eax
        subl    %ecx, %eax
        ret

It also helps with ARM (and pretty much any target that doesn't have a sext i1 :-).

The transformation was done as part of Eli's r75531. He has given the ok to
remove it.

rdar://11748024


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159230 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-26 22:03:13 +00:00
..
CMakeLists.txt llvm/lib: [CMake] Add explicit dependency to intrinsics_gen. 2012-06-24 13:32:01 +00:00
InstCombine.h add a new pass to instrument loads and stores for run-time bounds checking 2012-05-22 17:19:09 +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: disable optimization of 'invoke null/undef'. I'll move this functionality to SimplifyCFG (since we cannot make changes to the CFG here). 2012-06-21 23:52:14 +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 Replacing zero-sized alloca's with a null pointer is too aggressive, instead 2012-06-26 13:39:21 +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 Update instcombine for atomic load/store. 2011-08-15 22:09:40 +00:00
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 Always compute all the bits in ComputeMaskedBits. 2012-04-04 12:51:34 +00:00
InstCombineVectorOps.cpp continue making the world safe for ConstantDataVector. At this point, 2012-01-27 03:08:05 +00:00
InstCombineWorklist.h Use an iterator instead of calling .size() on the worklist every time, which is wasteful. 2012-03-15 11:19:41 +00:00
InstructionCombining.cpp improve optimization of invoke instructions: 2012-06-25 17:11:47 +00:00
LLVMBuild.txt LLVMBuild: Remove trailing newline, which irked me. 2011-12-12 19:48:00 +00:00
Makefile make -fno-rtti the default unless a directory builds with REQUIRES_RTTI. 2010-01-24 20:43:08 +00:00