llvm-6502/test
Evan Cheng de62192843 Throttle back "fold select into operand" transformation. InstCombine should not generate selects of two constants unless they are selects of 0 and 1.
e.g.
define i32 @t1(i32 %c, i32 %x) nounwind {
       %t1 = icmp eq i32 %c, 0
       %t2 = lshr i32 %x, 18
       %t3 = select i1 %t1, i32 %t2, i32 %x
       ret i32 %t3
}

was turned into

define i32 @t2(i32 %c, i32 %x) nounwind {
       %t1 = icmp eq i32 %c, 0
       %t2 = select i1 %t1, i32 18, i32 0
       %t3 = lshr i32 %x, %t2
       ret i32 %t3
}

For most targets, that means materializing two constants and then a select. e.g. On x86-64

movl    %esi, %eax
shrl    $18, %eax
testl   %edi, %edi
cmovne  %esi, %eax
ret

=>

xorl    %eax, %eax
testl   %edi, %edi
movl    $18, %ecx
cmovne  %eax, %ecx
movl    %esi, %eax
shrl    %cl, %eax
ret

Also, the optimizer and codegen can reason about shl / and / add, etc. by a constant. This optimization will hinder optimizations using ComputeMaskedBits.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68142 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-31 20:42:45 +00:00
..
Analysis change this to test for an alias result more directly. 2009-03-16 18:28:27 +00:00
Archive
Assembler Fix a bug in our autoupgrade support: in an argument list to a function 2009-03-25 06:36:36 +00:00
Bindings/Ocaml tweak this to accept asmprinter changes. I have no way to verify this, hopefully 2009-03-01 01:28:40 +00:00
Bitcode fix a bitcode reader bug where it can't handle extractelement correctly: 2009-02-03 02:11:28 +00:00
BugPoint Re-commit r67334 and r67349 with fix. 2009-03-21 18:12:24 +00:00
CodeGen Fully general expansion of integer shift of any size. 2009-03-31 19:39:24 +00:00
DebugInfo Global variables don't have a corresponding llvm.dbg.declare, yet it is possible 2009-03-10 13:41:26 +00:00
ExecutionEngine remove a testcase that depends on -debug existing. 2009-03-13 20:31:25 +00:00
Feature Don't load values out of global constants with weak 2009-03-20 21:53:29 +00:00
FrontendAda Adjust this test for recent sroa improvements. 2009-03-12 11:56:12 +00:00
FrontendC Add a __builtin___memset_chk test. 2009-03-27 02:45:14 +00:00
FrontendC++ These tests pass on linux. 2009-03-25 16:43:59 +00:00
FrontendFortran Testcase for PR2437. 2009-02-09 09:41:49 +00:00
FrontendObjC And now, not so elegant, test case... 2009-02-17 22:48:18 +00:00
FrontendObjC++ This is an objective-c test, not an objective-c++ one. 2008-10-06 18:42:48 +00:00
Integer Converted a1.ll to unittests. 2009-03-24 21:36:09 +00:00
lib Re-commit r67334 and r67349 with fix. 2009-03-21 18:12:24 +00:00
Linker Reimplement the old and horrible bison parser for .ll files with a nice 2009-01-02 07:01:27 +00:00
LLVMC Add a comment. 2009-03-06 17:59:58 +00:00
Other Update call graph after inlining invoke. 2009-03-31 17:36:12 +00:00
Scripts simplify shell syntax to work better on solaris, patch by 2008-06-25 16:03:42 +00:00
TableGen add support for a few simple escape characters in tblgen strings. 2009-03-13 21:03:27 +00:00
Transforms Throttle back "fold select into operand" transformation. InstCombine should not generate selects of two constants unless they are selects of 0 and 1. 2009-03-31 20:42:45 +00:00
Verifier Reimplement the old and horrible bison parser for .ll files with a nice 2009-01-02 07:01:27 +00:00
Makefile Re-commit r67334 and r67349 with fix. 2009-03-21 18:12:24 +00:00
Makefile.tests
TestRunner.sh Fix a bashism in TestRunner.sh. 2008-07-28 18:41:03 +00:00