summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert r108136 until I figure out why it broke selfhost.Benjamin Kramer2010-07-121-17/+0
| | | | llvm-svn: 108139
* instcombine: fold (x & y) | (~x & z) and (x & y) ^ (~x & z) into ((y ^ z) & ↵Benjamin Kramer2010-07-121-0/+17
| | | | | | | | | | | | | | | | | x) ^ z which is one instruction shorter. (PR6773) before: %and = and i32 %y, %x %neg = xor i32 %x, -1 %and4 = and i32 %z, %neg %xor = xor i32 %and4, %and after: %xor1 = xor i32 %z, %y %and2 = and i32 %xor1, %x %xor = xor i32 %and2, %z llvm-svn: 108136
* Minor code simplification.Dan Gohman2010-04-091-9/+5
| | | | llvm-svn: 100859
* Fix PR6503. This turned into a much more interesting and nasty bug. Various Chris Lattner2010-03-051-125/+92
| | | | | | | | | | | parts of the cmp|cmp and cmp&cmp folding logic wasn't prepared for vectors (unrelated to the bug but noticed while in the code) and the code was *definitely* not safe to use by the (cast icmp)|(cast icmp) handling logic that I added in r95855. Fix all this up by changing the various routines to more consistently use IRBuilder and not pass in the I which had the wrong type. llvm-svn: 97801
* simplify some functions and make them work with vectorChris Lattner2010-03-051-62/+25
| | | | | | compares, noticed by inspection. llvm-svn: 97795
* This test case:Bill Wendling2010-03-031-2/+4
| | | | | | | | | | | | | | | | | | | | | long test(long x) { return (x & 123124) | 3; } Currently compiles to: _test: orl $3, %edi movq %rdi, %rax andq $123127, %rax ret This is because instruction and DAG combiners canonicalize (or (and x, C), D) -> (and (or, D), (C | D)) However, this is only profitable if (C & D) != 0. It gets in the way of the 3-addressification because the input bits are known to be zero. llvm-svn: 97616
* There are two ways of checking for a given type, for example isa<PointerType>(T)Duncan Sands2010-02-161-2/+2
| | | | | | | and T->isPointerTy(). Convert most instances of the first form to the second form. Requested by Chris. llvm-svn: 96344
* Uniformize the names of type predicates: rather than having isFloatTy andDuncan Sands2010-02-151-4/+4
| | | | | | isInteger, we now have isFloatTy and isIntegerTy. Requested by Chris! llvm-svn: 96223
* Rename ValueRequiresCast to ShouldOptimizeCast, to better reflectChris Lattner2010-02-111-43/+75
| | | | | | | | | | | | | | what it does. Enhance it to return false to optimizing vector sign extensions from vector comparisions, which is the idiom used to get a splatted vector for a vector comparison. Doing this breaks vector-casts.ll, add some compensating transformations to handle the important case they cover without depending on this canonicalization. This fixes rdar://7434900 a serious pessimization of vector compares. llvm-svn: 95855
* Fix "the the" and similar typos.Dan Gohman2010-02-101-2/+2
| | | | llvm-svn: 95781
* simplify this code, duh.Chris Lattner2010-02-091-8/+4
| | | | llvm-svn: 95643
* fix PR6193, only considering sign extensions *from i1* for thisChris Lattner2010-02-091-5/+10
| | | | | | xform. llvm-svn: 95642
* fix logical-select to invoke filecheck right, and fix hte instcombineChris Lattner2010-02-051-1/+6
| | | | | | | | | xform it is checking to actually pass. There is no need to match m_SelectCst<0, -1> since instcombine canonicalizes that into not(sext). Add matches for sext(not(x)) in addition to not(sext(x)). llvm-svn: 95420
* don't turn (A & (C0?-1:0)) | (B & ~(C0?-1:0)) -> C0 ? A : BChris Lattner2010-02-021-9/+13
| | | | | | | for vectors. Codegen is generating awful code or segfaulting in various cases (e.g. PR6204). llvm-svn: 95058
* change the canonical form of "cond ? -1 : 0" to be Chris Lattner2010-01-241-6/+2
| | | | | | | | "sext cond" instead of a select. This simplifies some instcombine code, matches the policy for zext (cond ? 1 : 0 -> zext), and allows us to generate better code for a testcase on ppc. llvm-svn: 94339
* optimize ~(~X >>s Y) --> (X >>s Y), patch by Edmund GrimleyChris Lattner2010-01-191-0/+5
| | | | | | Evans! llvm-svn: 93884
* add one more bitfield optimization, allowing clang to generateChris Lattner2010-01-111-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | good code on PR4216: _test_bitfield: ## @test_bitfield orl $32962, %edi movl $4294941946, %eax andq %rdi, %rax ret instead of: _test_bitfield: movl $4294941696, %ecx movl %edi, %eax orl $194, %edi orl $32768, %eax andq $250, %rdi andq %rax, %rcx movq %rdi, %rax orq %rcx, %rax ret Evan is looking into the remaining andq+imm -> andl optimization. llvm-svn: 93147
* split and/or/xor out into one overly-large (2000LOC) file. However, I thinkChris Lattner2010-01-051-0/+1977
it does make sense to keep them together, at least for now. llvm-svn: 92711
OpenPOWER on IntegriCloud