Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | While SimplifyDemandedBits constant folds this, we can't rely on it here. | Benjamin Kramer | 2011-04-02 | 1 | -2/+7 |
| | | | | | | | | | | It's possible to craft an input that hits the recursion limits in a way that SimplifyDemandedBits doesn't simplify the icmp but ComputeMaskedBits can infer which bits are zero. No test case as it depends on too many other things. Fixes PR9609. llvm-svn: 128777 | ||||
* | Fix comment. | Benjamin Kramer | 2011-04-01 | 1 | -2/+2 |
| | | | | llvm-svn: 128745 | ||||
* | Tweaks to the icmp+sext-to-shifts optimization to address Frits' comments: | Benjamin Kramer | 2011-04-01 | 1 | -6/+6 |
| | | | | | | | | | | - Localize the check if an icmp has one use to a place where we know we're introducing something that's likely more expensive than a sext from i1. - Add an assert to make sure a case that would lead to a miscompilation is folded away earlier. - Fix a typo. llvm-svn: 128744 | ||||
* | Fix build. | Benjamin Kramer | 2011-04-01 | 1 | -1/+2 |
| | | | | llvm-svn: 128733 | ||||
* | InstCombine: Turn icmp + sext into bitwise/integer ops when the input has ↵ | Benjamin Kramer | 2011-04-01 | 1 | -0/+50 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | only one unknown bit. int test1(unsigned x) { return (x&8) ? 0 : -1; } int test3(unsigned x) { return (x&8) ? -1 : 0; } before (x86_64): _test1: andl $8, %edi cmpl $1, %edi sbbl %eax, %eax ret _test3: andl $8, %edi cmpl $1, %edi sbbl %eax, %eax notl %eax ret after: _test1: shrl $3, %edi andl $1, %edi leal -1(%rdi), %eax ret _test3: shll $28, %edi movl %edi, %eax sarl $31, %eax ret llvm-svn: 128732 | ||||
* | InstCombine: Move (sext icmp) transforms into their own method. No intended ↵ | Benjamin Kramer | 2011-04-01 | 2 | -37/+43 |
| | | | | | | functionality change. llvm-svn: 128731 | ||||
* | Instcombile optimization: extractelement(cast) -> cast(extractelement) | Nadav Rotem | 2011-03-31 | 1 | -1/+9 |
| | | | | llvm-svn: 128683 | ||||
* | InstCombine: APFloat can't perform arithmetic on PPC double doubles, don't ↵ | Benjamin Kramer | 2011-03-31 | 1 | -2/+4 |
| | | | | | | | | even try. Thanks Eli! llvm-svn: 128676 | ||||
* | InstCombine: Fix transform to use the swapped predicate. | Benjamin Kramer | 2011-03-31 | 1 | -2/+2 |
| | | | | | | Thanks Frits! llvm-svn: 128628 | ||||
* | InstCombine: fold fcmp (fneg x), (fneg y) -> fcmp x, y | Benjamin Kramer | 2011-03-31 | 1 | -0/+5 |
| | | | | llvm-svn: 128627 | ||||
* | InstCombine: fold fcmp pred (fneg x), C -> fcmp swap(pred) x, -C | Benjamin Kramer | 2011-03-31 | 1 | -0/+8 |
| | | | | llvm-svn: 128626 | ||||
* | InstCombine: Shrink "fcmp (fpext x), C" to "fcmp x, C" if C can be ↵ | Benjamin Kramer | 2011-03-31 | 1 | -0/+34 |
| | | | | | | | | losslessly converted to the type of x. Fixes PR9592. llvm-svn: 128625 | ||||
* | InstCombine: fold fcmp (fpext x), (fpext y) -> fcmp x, y. | Benjamin Kramer | 2011-03-31 | 1 | -0/+7 |
| | | | | llvm-svn: 128624 | ||||
* | * The DSE code that tested for overlapping needed to take into account the fact | Bill Wendling | 2011-03-30 | 1 | -1/+3 |
| | | | | | | | | | | | | that one of the numbers is signed while the other is unsigned. This could lead to a wrong result when the signed was promoted to an unsigned int. * Add the data layout line to the testcase so that it will test the appropriate thing. Patch by David Terei! llvm-svn: 128577 | ||||
* | InstCombine: If the divisor of an fdiv has an exact inverse, turn it into an ↵ | Benjamin Kramer | 2011-03-30 | 1 | -0/+12 |
| | | | | | | | | fmul. Fixes PR9587. llvm-svn: 128546 | ||||
* | Remove PHINode::reserveOperandSpace(). Instead, add a parameter to | Jay Foad | 2011-03-30 | 25 | -62/+44 |
| | | | | | | PHINode::Create() giving the (known or expected) number of operands. llvm-svn: 128537 | ||||
* | (Almost) always call reserveOperandSpace() on newly created PHINodes. | Jay Foad | 2011-03-30 | 19 | -15/+38 |
| | | | | llvm-svn: 128535 | ||||
* | InstCombine: Add a few missing combines for ANDs and ORs of sign bit tests. | Benjamin Kramer | 2011-03-29 | 1 | -0/+24 |
| | | | | | | | | On x86 we now compile "if (a < 0 && b < 0)" into testl %edi, %esi js IF.THEN llvm-svn: 128496 | ||||
* | DSE: Remove an early exit optimization that depended on the ordering of a ↵ | Benjamin Kramer | 2011-03-29 | 1 | -13/+0 |
| | | | | | | | | SmallPtrSet. Fixes PR9569 and will hopefully make selfhost on ASLR-enabled systems more deterministic. llvm-svn: 128482 | ||||
* | Do some simple copy propagation through integer loads and stores when promoting | Cameron Zwarich | 2011-03-29 | 1 | -9/+14 |
| | | | | | | | vector types. This helps a lot with inlined functions when using the ARM soft float ABI. Fixes <rdar://problem/9184212>. llvm-svn: 128453 | ||||
* | Remove tabs I accidentally added. | Nick Lewycky | 2011-03-28 | 1 | -15/+15 |
| | | | | llvm-svn: 128413 | ||||
* | Make more use of PHINode::getNumIncomingValues(). | Jay Foad | 2011-03-28 | 2 | -5/+5 |
| | | | | llvm-svn: 128406 | ||||
* | Add some debug output when -instcombine uses RAUW. This can make debug ↵ | Frits van Bommel | 2011-03-27 | 1 | -1/+4 |
| | | | | | | output for those cases much clearer since without this it only showed that the original instruction was removed, not what it was replaced with. llvm-svn: 128399 | ||||
* | Teach the transformation that moves binary operators around selects to preserve | Nick Lewycky | 2011-03-27 | 1 | -8/+22 |
| | | | | | | the subclass optional data. llvm-svn: 128388 | ||||
* | Use APInt's umul_ov instead of rolling our own overflow detection. | Benjamin Kramer | 2011-03-27 | 1 | -5/+6 |
| | | | | llvm-svn: 128380 | ||||
* | Add a small missed optimization: turn X == C ? X : Y into X == C ? C : Y. This | Nick Lewycky | 2011-03-27 | 1 | -0/+13 |
| | | | | | | | | | | removes one use of X which helps it pass the many hasOneUse() checks. In my analysis, this turns up very often where X = A >>exact B and that can't be simplified unless X has one use (except by increasing the lifetime of A which is generally a performance loss). llvm-svn: 128373 | ||||
* | Simplification noticed by Frits. | Bill Wendling | 2011-03-26 | 1 | -3/+2 |
| | | | | llvm-svn: 128333 | ||||
* | Rework the logic that determines if a store completely overlaps an ealier store. | Bill Wendling | 2011-03-26 | 1 | -15/+23 |
| | | | | | | | | | | | There are two ways that a later store can comletely overlap a previous store: 1. They both start at the same offset, but the earlier store's size is <= the later's size, or 2. The earlier store's offset is > the later's offset, but it's offset + size doesn't extend past the later's offset + size. llvm-svn: 128332 | ||||
* | Fix a typo and add a test. | Cameron Zwarich | 2011-03-26 | 1 | -1/+1 |
| | | | | llvm-svn: 128331 | ||||
* | PR9561: A store with a negative offset (via GEP) could erroniously say that it | Bill Wendling | 2011-03-26 | 1 | -0/+2 |
| | | | | | | | completely overlaps a previous store, thus mistakenly deleting that store. Check for this condition. llvm-svn: 128319 | ||||
* | No functionality change, just adjust some whitespace for coding style ↵ | Nick Lewycky | 2011-03-25 | 1 | -2/+2 |
| | | | | | | compliance. llvm-svn: 128257 | ||||
* | Debug intrinsics must be skipped at the beginning and ends of blocks, lest they | Cameron Zwarich | 2011-03-24 | 1 | -2/+6 |
| | | | | | | affect the generated code. llvm-svn: 128217 | ||||
* | It is enough for the CallInst to have no uses to be made a tail call with a ret | Cameron Zwarich | 2011-03-24 | 1 | -1/+1 |
| | | | | | | void; it doesn't need to have a void type. llvm-svn: 128212 | ||||
* | s/UpdateDT/ModifiedDT/g | Devang Patel | 2011-03-24 | 1 | -8/+8 |
| | | | | llvm-svn: 128211 | ||||
* | Do early taildup of ret in CodeGenPrepare for potential tail calls that have a | Cameron Zwarich | 2011-03-24 | 1 | -17/+37 |
| | | | | | | void return type. This fixes PR9487. llvm-svn: 128197 | ||||
* | Use an early return instead of a long if block. | Cameron Zwarich | 2011-03-24 | 1 | -51/+51 |
| | | | | llvm-svn: 128196 | ||||
* | When UpdateDT is set, DT is invalid, which could cause problems when trying to | Cameron Zwarich | 2011-03-24 | 1 | -2/+3 |
| | | | | | | use it later. I couldn't make a test that hits this with the current code. llvm-svn: 128195 | ||||
* | Check for TLI so that -codegenprepare can be used from opt. | Cameron Zwarich | 2011-03-24 | 1 | -0/+3 |
| | | | | llvm-svn: 128194 | ||||
* | Fix PR9464 by correcting some math that just happened to be right in most cases | Cameron Zwarich | 2011-03-23 | 1 | -11/+10 |
| | | | | | | that were hit in practice. llvm-svn: 128146 | ||||
* | Handle another case that Frits suggested. | Anders Carlsson | 2011-03-22 | 1 | -2/+4 |
| | | | | llvm-svn: 128068 | ||||
* | Simplify. | Devang Patel | 2011-03-21 | 1 | -5/+4 |
| | | | | llvm-svn: 128030 | ||||
* | More cleanups to the OptimizeEmptyGlobalCXXDtors GlobalOpt function. | Anders Carlsson | 2011-03-21 | 1 | -15/+9 |
| | | | | llvm-svn: 127997 | ||||
* | As suggested by Nick Lewycky, ignore debugging intrinsics when trying to ↵ | Anders Carlsson | 2011-03-21 | 1 | -0/+7 |
| | | | | | | decide whether a destructor is empty or not. llvm-svn: 127985 | ||||
* | Fix comments | Nick Lewycky | 2011-03-21 | 1 | -2/+2 |
| | | | | llvm-svn: 127984 | ||||
* | Re-apply r127953 with fixes: eliminate empty return block if it has no ↵ | Evan Cheng | 2011-03-21 | 1 | -10/+122 |
| | | | | | | predecessors; update dominator tree if cfg is modified. llvm-svn: 127981 | ||||
* | Don't try to eliminate invokes to __cxa_atexit. | Anders Carlsson | 2011-03-20 | 1 | -0/+6 |
| | | | | llvm-svn: 127976 | ||||
* | Don't segfault on mutual recursion, as pointed out by Frits. | Anders Carlsson | 2011-03-20 | 1 | -4/+6 |
| | | | | llvm-svn: 127975 | ||||
* | Address comments from Frits van Bommel. | Anders Carlsson | 2011-03-20 | 1 | -7/+16 |
| | | | | llvm-svn: 127974 | ||||
* | Add an optimization to GlobalOpt that eliminates calls to __cxa_atexit, if ↵ | Anders Carlsson | 2011-03-20 | 1 | -0/+101 |
| | | | | | | the function passed is empty. llvm-svn: 127970 | ||||
* | Revert r127953, "SimplifyCFG has stopped duplicating returns into predecessors | Daniel Dunbar | 2011-03-19 | 1 | -99/+4 |
| | | | | | | to canonicalize IR", it broke a lot of things. llvm-svn: 127954 |