summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine/or.ll
Commit message (Collapse)AuthorAgeFilesLines
...
* Reorders two transforms that collide with each otherDavid Majnemer2013-04-141-3/+3
| | | | | | | | | | | | | | | | | | | | | | One performs: (X == 13 | X == 14) -> X-13 <u 2 The other: (A == C1 || A == C2) -> (A & ~(C1 ^ C2)) == C1 The problem is that there are certain values of C1 and C2 that trigger both transforms but the first one blocks out the second, this generates suboptimal code. Reordering the transforms should be better in every case and allows us to do interesting stuff like turn: %shr = lshr i32 %X, 4 %and = and i32 %shr, 15 %add = add i32 %and, -14 %tobool = icmp ne i32 %add, 0 into: %and = and i32 %X, 240 %tobool = icmp ne i32 %and, 224 llvm-svn: 179493
* The transform is:Bill Wendling2013-02-161-3/+2
| | | | | | | | | | | | | | | (or (bool?A:B),(bool?C:D)) --> (bool?(or A,C):(or B,D)) By the time the OR is visited, both the SELECTs have been visited and not optimized and the OR itself hasn't been transformed so we do this transform in the hopes that the new ORs will be optimized. The transform is explicitly disabled for vector-selects until "codegen matures to handle them better". Patch by Muhammad Tauqir! llvm-svn: 175380
* More instcombine cleanup, towards improving debug line info.Eli Friedman2011-05-181-2/+2
| | | | llvm-svn: 131604
* Add an instcombine for constructs like a | -(b != c); a select is moreEli Friedman2011-04-141-0/+19
| | | | | | | canonical, and generally leads to better code. Found while looking at an article about saturating arithmetic. llvm-svn: 129545
* Teach InstCombine to merge (icmp ult (X + CA), C1) | (icmp eq X, C2) into ↵Benjamin Kramer2010-12-201-0/+14
| | | | | | | | | | | | | | | (icmp ult (X + CA), C1 + 1) if C2 + CA == C1. InstCombine creates these so now we compile x == 23 || x == 24 || x == 25 to %x.off = add i32 %x, -23 %1 = icmp ult i32 %x.off, 3 instead of %x.off = add i32 %x, -23 %1 = icmp ult i32 %x.off, 2 %cmp3 = icmp eq i32 %x, 25 %ret2 = or i1 %1, %cmp3 llvm-svn: 122248
* Re-apply r113679, which was reverted in r113720, which added a paid of new ↵Owen Anderson2010-09-131-4/+13
| | | | | | | | | instcombine transforms to expose greater opportunities for store narrowing in codegen. This patch fixes a potential infinite loop in instcombine caused by one of the introduced transforms being overly aggressive. llvm-svn: 113763
* Revert 113679, it was causing an infinite loop in a testcase that I've sentEric Christopher2010-09-121-13/+4
| | | | | | on to Owen. llvm-svn: 113720
* Invert and-of-or into or-of-and when doing so would allow us to clear bits ↵Owen Anderson2010-09-111-4/+13
| | | | | | | | | | | | | | of the and's mask. This can result in increased opportunities for store narrowing in code generation. Update a number of tests for this change. This fixes <rdar://problem/8285027>. Additionally, because this inverts the order of ors and ands, some patterns for optimizing or-of-and-of-or no longer fire in instances where they did originally. Add a simple transform which recaptures most of these opportunities: if we have an or-of-constant-or and have failed to fold away the inner or, commute the order of the two ors, to give the non-constant or a chance for simplification instead. llvm-svn: 113679
* Teach InstructionSimplify to fold (A & B) & A -> A & B and (A | B) | A -> A | B.Benjamin Kramer2010-09-101-0/+17
| | | | | | Reassociate does this but it doesn't catch all cases (e.g. if the operands are i1). llvm-svn: 113651
* revert r108320, I see the failures now...Chris Lattner2010-07-141-13/+0
| | | | llvm-svn: 108322
* reapply benjamin's instcombine patch, I don't see anything wrong with it and ↵Chris Lattner2010-07-141-0/+13
| | | | | | can't repro any problems with a manual self-host. llvm-svn: 108320
* Nope, still breaks the release selfhost bots :(Benjamin Kramer2010-07-121-13/+0
| | | | llvm-svn: 108153
* Reapply the "or" half of r108136, which seems to be less problematic.Benjamin Kramer2010-07-121-0/+13
| | | | llvm-svn: 108152
* Revert r108141 again, sigh.Benjamin Kramer2010-07-121-13/+0
| | | | llvm-svn: 108148
* Reapply 108136 with an ugly pasto fixed.Benjamin Kramer2010-07-121-0/+13
| | | | llvm-svn: 108141
* Revert r108136 until I figure out why it broke selfhost.Benjamin Kramer2010-07-121-14/+0
| | | | llvm-svn: 108139
* instcombine: fold (x & y) | (~x & z) and (x & y) ^ (~x & z) into ((y ^ z) & ↵Benjamin Kramer2010-07-121-0/+14
| | | | | | | | | | | | | | | | | 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
* make these less sensitive to temporary naming.Chris Lattner2010-03-051-10/+10
| | | | llvm-svn: 97799
* don't turn (A & (C0?-1:0)) | (B & ~(C0?-1:0)) -> C0 ? A : BChris Lattner2010-02-021-0/+14
| | | | | | | for vectors. Codegen is generating awful code or segfaulting in various cases (e.g. PR6204). llvm-svn: 95058
* add one more bitfield optimization, allowing clang to generateChris Lattner2010-01-111-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* implement an instcombine xform needed by clang's codegenChris Lattner2010-01-041-0/+13
| | | | | | | | on the example in PR4216. This doesn't trigger in the testsuite, so I'd really appreciate someone scrutinizing the logic for correctness. llvm-svn: 92458
* Fix logic error in previous commit. The != case needs to become an or, not anNick Lewycky2010-01-021-0/+14
| | | | | | and. llvm-svn: 92419
* Optimize pointer comparison into the typesafe form, now that the backends willNick Lewycky2010-01-021-0/+13
| | | | | | | handle them efficiently. This is the opposite direction of the transformation we used to have here. llvm-svn: 92418
* remove the instcombine transformations that are inserting nastyChris Lattner2010-01-021-15/+0
| | | | | | | | | | | pointer to int casts that confuse later optimizations. See PR3351 for details. This improves but doesn't complete fix 483.xalancbmk because llvm-gcc does this xform in GCC's "fold" routine as well. Clang++ will do better I guess. llvm-svn: 92408
* Implement PR5634.Chris Lattner2009-11-291-1/+43
| | | | llvm-svn: 90046
* reapply r85085 with a bugfix to avoid infinite looping.Chris Lattner2009-10-261-1/+0
| | | | | | | All of the 'demorgan' related xforms need to use dyn_castNotVal, not m_Not. llvm-svn: 85119
* Revert 85085. It causes infinite looping during llvm-gcc build.Evan Cheng2009-10-261-0/+1
| | | | llvm-svn: 85090
* Implement PR3266 & PR5276, folding:Chris Lattner2009-10-261-1/+16
| | | | | | not (or (icmp, icmp)) -> and(icmp, icmp) llvm-svn: 85085
* convert or.ll to filecheck and merge or2 into it.Chris Lattner2009-10-251-59/+128
| | | | llvm-svn: 85083
* Change tests from "opt %s" to "opt < %s" so that opt doesn't see theDan Gohman2009-09-111-1/+1
| | | | | | | | input filename so that opt doesn't print the input filename in the output so that grep lines in the tests don't unintentionally match strings in the input filename. llvm-svn: 81537
* Use opt -S instead of piping bitcode output through llvm-dis.Dan Gohman2009-09-081-1/+1
| | | | llvm-svn: 81257
* Change these tests to feed the assembly files to opt directly, insteadDan Gohman2009-09-081-1/+1
| | | | | | of using llvm-as, now that opt supports this. llvm-svn: 81226
* Remove llvm-upgrade and update test cases.Tanya Lattner2008-03-011-107/+120
| | | | llvm-svn: 47793
* For PR1319:Reid Spencer2007-04-151-0/+1
| | | | | | | Make use of the END. facility on all files > 1K so that we aren't wasting CPU cycles searching for RUN: lines that we'll never find. llvm-svn: 36059
* For PR1319:Reid Spencer2007-04-141-3/+2
| | | | | | Upgrade tests to work with new llvm.exp version of llvm_runtest. llvm-svn: 36013
* Regression is gone, don't try to find it on clean target.Reid Spencer2007-01-171-0/+158
llvm-svn: 33296
OpenPOWER on IntegriCloud