llvm/lib
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
..
Analysis Enable the new LoopInfo algorithm by default. 2012-06-26 04:11:38 +00:00
Archive Include cstdio in a few place that depended on getting it transitively through StringExtras.h 2012-03-23 11:35:30 +00:00
AsmParser Extend the IL for selecting TLS models (PR9788) 2012-06-23 11:37:03 +00:00
Bitcode llvm/lib: [CMake] Add explicit dependency to intrinsics_gen. 2012-06-24 13:32:01 +00:00
CodeGen Allow targets to inject passes before the virtual register rewriter. 2012-06-26 17:09:29 +00:00
DebugInfo Fix a C++11 UDL conflict. 2012-04-04 20:33:56 +00:00
ExecutionEngine llvm/lib: [CMake] Add explicit dependency to intrinsics_gen. 2012-06-24 13:32:01 +00:00
Linker Extend the IL for selecting TLS models (PR9788) 2012-06-23 11:37:03 +00:00
MC EmitZerofill should take a 64-bit size or else it's chopping off large zero-filled global. rdar://11729134 2012-06-22 20:14:46 +00:00
Object Added accessors for getting coff_relocation info 2012-06-18 19:47:16 +00:00
Support Implement getHostCPUName for ARM/linux. This will be used to implement -march=native in clang. 2012-06-26 21:36:32 +00:00
TableGen Emit TableGen's header comment with C-style comments, so it can be used from C89 code. 2012-06-19 17:04:16 +00:00
Target X86: add GATHER intrinsics (AVX2) in LLVM 2012-06-26 19:47:59 +00:00
Transforms Remove a instcombine transform that (no longer?) makes sense: 2012-06-26 22:03:13 +00:00
VMCore improve optimization of invoke instructions: 2012-06-25 17:11:47 +00:00
CMakeLists.txt Move TableGen's parser and entry point into a library 2011-10-01 16:41:13 +00:00
LLVMBuild.txt LLVMBuild: Introduce a common section which currently has a list of the 2011-12-12 22:45:54 +00:00
Makefile Remove more of llvmc and dependencies. 2011-09-20 00:34:27 +00:00