Commit Graph

33705 Commits

Author SHA1 Message Date
Evan Cheng
f40888dc9b Block terminator may be a switch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86761 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 00:00:21 +00:00
Chris Lattner
1742498b5a add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86756 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 23:47:45 +00:00
Chris Lattner
b6ad9153dd I did this a week or two ago
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86754 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 23:40:49 +00:00
Devang Patel
fb0ee43438 Ignore variable if scope info is not available.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86753 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 23:20:04 +00:00
Dale Johannesen
9a645cd9d4 Emit correct code when making a ConstantPool entry for a vector
constant whose component type is not a legal type for the target.
(If the target ConstantPool cannot handle this type either, it has
an opportunity to merge elements.  In practice any target with
8-bit bytes must support i8 *as data*).  7320806 (partial).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86751 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 23:16:41 +00:00
Devang Patel
53bb5c95af Implement support to debug inlined functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86748 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 23:06:00 +00:00
Chris Lattner
055d046f48 implement a TODO by teaching jump threading about "xor x, 1".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86739 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 22:39:16 +00:00
Chris Lattner
40d8c28b27 move some generally useful functions out of jump threading
into libanalysis and transformutils.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86735 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 22:26:15 +00:00
Dan Gohman
5b37fbac1a Don't mark conditional branch instructions as control barriers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86732 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 22:16:57 +00:00
Bill Wendling
b19a5e9be6 Modify how the prologue encoded the "move" information for the FDE. GCC
generates a sequence similar to this:

__Z4funci:
LFB2:
        mflr r0
LCFI0:
        stmw r30,-8(r1)
LCFI1:
        stw r0,8(r1)
LCFI2:
        stwu r1,-80(r1)
LCFI3:
        mr r30,r1
LCFI4:

where LCFI3 and LCFI4 are used by the FDE to indicate what the FP, LR, and other
things are. We generated something more like this:

Leh_func_begin1:
        mflr r0
        stw r31, 20(r1)
        stw r0, 8(r1)
Llabel1:
        stwu r1, -80(r1)
Llabel2:
        mr r31, r1

Note that we are missing the "mr" instruction. This patch makes it more like the
GCC output.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86729 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 22:14:04 +00:00
Devang Patel
6daf99bf8f Process InlinedAt location info.
Update InsertDeclare to return newly inserted llvm.dbg.declare intrinsic.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86727 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 22:05:35 +00:00
Chris Lattner
103f2434b8 fix a crash in SCCP handling extractvalue of an array, pointed out and
tracked down by Stephan Reiter!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86726 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 22:02:09 +00:00
Jakob Stoklund Olesen
f235f13931 Teach PHIElimination to split critical edges when -split-phi-edges is enabled.
Critical edges leading to a PHI node are split when the PHI source variable is
live out from the predecessor block. This help the coalescer eliminate more
PHI joins.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86725 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 22:01:05 +00:00
Jakob Stoklund Olesen
e35e3c33dc Refactoring: Extract method PHIElimination::isLiveOut().
Clean up some whitespace.
No functional changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86724 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 22:00:56 +00:00
Chris Lattner
6f84a5feee improve comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86723 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 21:45:09 +00:00
Chris Lattner
f3183f6da6 Make jump threading eliminate blocks that just contain phi nodes,
debug intrinsics, and an unconditional branch when possible.  This
reuses the TryToSimplifyUncondBranchFromEmptyBlock function split
out of simplifycfg.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86722 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 21:40:01 +00:00
Evan Cheng
81ebdcf7dd Generalize lsr code that optimize loop to count down towards zero.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86715 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 21:14:05 +00:00
Victor Hernandez
f06dca2918 make this handle redefinition of malloc function with different prototype correctly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86712 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 19:53:28 +00:00
Evan Cheng
4b6bbe1e9c Change Thumb1 address mode printing, instead of
[r0, #2 * 4]
Now
[r0, #8]

This makes Thumb2 assembly more uniform and frankly the scale doesn't add much.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86707 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 19:48:13 +00:00
Evan Cheng
1e13c797e5 Add a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86706 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 19:44:56 +00:00
Duncan Sands
650c64383e Add defensive break.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86705 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 19:36:40 +00:00
Daniel Dunbar
5da58851e5 Add a monstrous hack to improve X86ISelDAGToDAG compile time.
- Force NDEBUG on in any Release build. This drops the compile time to ~100s
   from ~600s, in Release mode.

 - This may just be a temporary workaround, I don't know the true nature of the
   gcc-4.2 compile time performance problem.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86695 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 18:24:37 +00:00
Duncan Sands
e3f749b166 Fix obvious typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86694 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 18:21:37 +00:00
Chris Lattner
6b583919d9 clarify logic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86689 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 17:00:47 +00:00
Duncan Sands
710c37c494 Teach DSE to eliminate useless trampolines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86683 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 13:49:50 +00:00
Duncan Sands
e9097f7438 Add brackets to make gcc-4.4 happy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86681 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 09:32:10 +00:00
Duncan Sands
f07c9497b2 Codegen support for the llvm.invariant/lifetime.start/end intrinsics:
just throw them away.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86678 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 09:08:09 +00:00
Victor Hernandez
8e345a1c41 Update computeArraySize() to use ComputeMultiple() to determine the array size associated with a malloc; also extend PerformHeapAllocSRoA() to check if the optimized malloc's arg had its highest bit set, so that it is safe for ComputeMultiple() to look through sext instructions while determining the optimized malloc's array size
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86676 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 08:32:25 +00:00
Victor Hernandez
2b6705f5e7 Add ComputeMultiple() analysis function that recursively determines if a Value V is a multiple of unsigned Base
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86675 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 08:28:35 +00:00
Chris Lattner
c22d4d1500 unify the code that determines whether it is a good idea to change the type
of a computation.  This fixes some infinite loops when dealing with TD that
has no native types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86670 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 07:23:37 +00:00
Nick Lewycky
7cef178176 Simplify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86668 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 07:00:43 +00:00
Nick Lewycky
58571d663c Reapply r86359, "Teach dead store elimination that certain intrinsics write to
memory just like a store" with bug fixed (partial-overwrite.ll is the
regression test).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86667 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 06:46:40 +00:00
Chris Lattner
dce94d92df refactor TryToSimplifyUncondBranchFromEmptyBlock out of SimplifyCFG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86666 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 05:59:26 +00:00
Oscar Fuentes
c5e1ae1313 CMake: Support for building llvm loadable modules.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86656 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 02:45:37 +00:00
Bruno Cardoso Lopes
734516d1f6 Fix PR5445
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86651 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 02:35:13 +00:00
Chris Lattner
70ce6d0819 I misread the parens, not so redundant after all.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86648 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 02:04:54 +00:00
Chris Lattner
fddcf47a24 make jump threading recursively simplify expressions instead of doing it
just one level deep.  On the testcase we go from getting this:

F1:                                               ; preds = %T2
  %F = and i1 true, %cond                         ; <i1> [#uses=1]
  br i1 %F, label %X, label %Y

to a fully threaded:

F1:                                               ; preds = %T2
  br label %Y


This changes gets us to the point where we're forming (too many) switch 
instructions on doug's strswitch testcase.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86646 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 01:57:31 +00:00
Chris Lattner
9f3ce36d7e remove some redundant parens.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86645 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 01:56:04 +00:00
Dan Gohman
7071528e4e Remove an unused variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86642 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 01:37:57 +00:00
Dan Gohman
b2e40990c4 Minor code simplification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86641 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 01:36:20 +00:00
Chris Lattner
e7c90967b1 don't invalidate PN, rewrite of this code is in progress anyway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86639 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 01:19:06 +00:00
Chris Lattner
e34537856a add a new SimplifyInstruction API, which is like ConstantFoldInstruction,
except that the result may not be a constant.  Switch jump threading to 
use it so that it gets things like (X & 0) -> 0, which occur when phi preds
are deleted and the remaining phi pred was a zero.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86637 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 01:08:51 +00:00
Jeffrey Yasskin
81cf432569 Fix DenseMap iterator constness.
This patch forbids implicit conversion of DenseMap::const_iterator to
DenseMap::iterator which was possible because DenseMapIterator inherited
(publicly) from DenseMapConstIterator. Conversion the other way around is now
allowed as one may expect.

The template DenseMapConstIterator is removed and the template parameter
IsConst which specifies whether the iterator is constant is added to
DenseMapIterator.

Actually IsConst parameter is not necessary since the constness can be
determined from KeyT but this is not relevant to the fix and can be addressed
later.

Patch by Victor Zverovich!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86636 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 01:02:17 +00:00
Chris Lattner
d06094f068 factor simplification logic for AND and OR out to InstSimplify from instcombine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86635 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 00:55:12 +00:00
David Goodwin
c2e8a7e8d2 Fixed to address code review. No functional changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86634 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 00:48:55 +00:00
Daniel Dunbar
d65267ee62 Fix MemoryBuffer::getSTDIN to *not* return null if stdin is empty, this is a lame API.
Also, Stringrefify some more MemoryBuffer functions, and add two performance FIXMEs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86630 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 00:43:58 +00:00
David Goodwin
0855dee564 Allow targets to specify register classes whose member registers should not be renamed to break anti-dependencies.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86628 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 00:15:47 +00:00
Chris Lattner
210c5d4880 pull a bunch of logic out of instcombine into instsimplify for compare
simplification, this handles the foldable fcmp x,x cases among many others.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86627 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 23:55:12 +00:00
Dan Gohman
1ba3b6c565 Pass the (optional) TargetData object to ConstantFoldInstOperands
and ConstantFoldCompareInstOperands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86626 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 23:34:17 +00:00
Chris Lattner
b0bdac06b2 inline a simple function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86625 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 23:31:49 +00:00