Commit Graph

10455 Commits

Author SHA1 Message Date
Duncan Sands
a3da922a27 Don't trivially delete unused calls to llvm.invariant.start. This allows
llvm.invariant.start to be used without necessarily being paired with a call
to llvm.invariant.end.  If you run the entire optimization pipeline then such
calls are in fact deleted (adce does it), but that's actually a good thing since
we probably do want them to be zapped late in the game.  There should really be
an integration test that checks that the llvm.invariant.start call lasts long
enough that all passes that do interesting things with it get to do their stuff
before it is deleted.  But since no passes do anything interesting with it yet
this will have to wait for later.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86840 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 15:34:13 +00:00
Chris Lattner
f8fb7c26ee remove the now dead condprop pass, PR3906.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86810 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 05:56:35 +00:00
Daniel Dunbar
a8333d3d10 Add StringRef::split(StringRef), to complement StringRef::split(char).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86803 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 05:19:11 +00:00
Chris Lattner
cc4d3b25f3 stub out some LazyValueInfo interfaces, and have JumpThreading
start using them in a trivial way when -enable-jump-threading-lvi
is passed.  enable-jump-threading-lvi will be my playground for 
awhile.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86789 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 02:08:33 +00:00
Daniel Dunbar
3691393b86 Add Triple::str() which returns the contents of the Triple as a string, as a more readable alternative to getTriple().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86773 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 00:43:14 +00:00
Daniel Dunbar
64066bd8b5 Add From arguments to StringRef search functions, and tweak doxyments.
Also, add unittests for find_first_of and find_first_not_of.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86770 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 00:28:53 +00:00
Chris Lattner
10f2d13d58 Stub out a new lazy value info pass, which will eventually
vend value constraint information to the optimizer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86767 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 00:22:30 +00:00
Chris Lattner
68cf6042c1 remove redundant foward declaration. This function is already in
Analysis/Passes.h



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86765 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 00:21:21 +00:00
Chris Lattner
6eb8dd2276 jump threading does everything that condprop does any more. This passes
bootstrap on darwin i386.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86758 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 23:54:10 +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
0a26870d92 in -dot-cfg and -dot-cfg-only, when rendering switch instructions,
put the switch value in the successor boxes like we put T/F for branches.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86747 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 22:56:15 +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
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
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
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
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
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
9dbb42944c rename SimplifyCompare -> SimplifyCmpInst and split it into
Simplify[IF]Cmp pieces.  Add some predicates to CmpInst to 
determine whether a predicate is fp or int.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86624 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 23:28:39 +00:00
Chris Lattner
8f73deaa87 fix ConstantFoldCompareInstOperands to take the LHS/RHS as
individual operands instead of taking a temporary array


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86619 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 23:06:58 +00:00
Daniel Dunbar
38424c9b5d Add StringSwitch::Cases overloads, for matching multiple strings to a single
value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86618 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 23:05:44 +00:00
Chris Lattner
9f3c25aeb3 stub out a new libanalysis "instruction simplify" interface that
takes decimated instructions and applies identities to them.  This
is pretty minimal at this point, but I plan to pull some instcombine
logic out into these and similar routines.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86613 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 22:57:59 +00:00
Jeffrey Yasskin
6f348e4586 Remove dlsym stubs, with Nate Begeman's permission.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86606 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 22:34:19 +00:00
Dan Gohman
80f6c58981 Print "..." instead of all the uninteresting register clobbers on call
instructions. This makes CodeGen dumps significantly less noisy.

Example before:
  BL <ga:@bar>, %R0<imp-def>, %R1<imp-def,dead>, %R2<imp-def,dead>, %R3<imp-def,dead>, %R12<imp-def,dead>, %LR<imp-def,dead>, %D0<imp-def,dead>, %D1<imp-def,dead>, %D2<imp-def,dead>, %D3<imp-def,dead>, %D4<imp-def,dead>, %D5<imp-def,dead>, %D6<imp-def,dead>, %D7<imp-def,dead>, %D16<imp-def,dead>, %D17<imp-def,dead>, %D18<imp-def,dead>, %D19<imp-def,dead>, %D20<imp-def,dead>, %D21<imp-def,dead>, %D22<imp-def,dead>, %D23<imp-def,dead>, %D24<imp-def,dead>, %D25<imp-def,dead>, %D26<imp-def,dead>, %D27<imp-def,dead>, %D28<imp-def,dead>, %D29<imp-def,dead>, %D30<imp-def,dead>, %D31<imp-def,dead>, %CPSR<imp-def,dead>, %FPSCR<imp-def,dead>

Same example after:
  BL <ga:@bar>, %R0<imp-def>, %R1<imp-def,dead>, %LR<imp-def,dead>, %CPSR<imp-def,dead>, ...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86583 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 19:38:45 +00:00
Dan Gohman
d146e986c8 Fix an 80-column violation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86567 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 18:20:38 +00:00
Dan Gohman
28a4c78621 Constify MachineFunctionAnalysis' TargetMachine reference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86564 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 18:18:49 +00:00
Dan Gohman
1edb8e0910 Fix a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86558 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 17:06:51 +00:00
Dan Gohman
9d51c972c1 Suppress implicit copy ctor and copy assignment for MachineFunction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86557 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 17:06:23 +00:00
Nuno Lopes
95a3be0ba4 add zextOrTrunc and sextOrTrunc methods, that are similar to the ones in APInt
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86549 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 15:36:28 +00:00
Oscar Fuentes
6a660d4a43 CMake: Detect gv, circo, twopi, neato, fdo, dot and dotty.
Patch by Arnaud Allard de Grandmaison!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86547 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 15:26:40 +00:00
Chris Lattner
0dd3b7645b fix some bogus asserts, PR5049
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86514 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 04:47:27 +00:00
Lang Hames
16dcaf5996 Moved some ManagedStatics out of the SlotIndexes header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86446 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-08 08:49:59 +00:00
Daniel Dunbar
d71153577f Fix class -> struct tag.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86416 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-07 23:21:30 +00:00
Chris Lattner
9e496d2231 all targets should be required to declare legal integer types. My plan to
make it optional doesn't work out.  If you don't want to specify this, don't
specify a TD string at all.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86394 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-07 18:53:00 +00:00
Anton Korobeynikov
8983da729a Add 8 bit libcalls and make use of them for msp430
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86384 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-07 17:14:39 +00:00
Chris Lattner
e82bdc4809 add the ability for TargetData to return information about legal integer
datatypes on a given CPU.  This is intended to allow instcombine and other
transformations to avoid converting big sequences of operations to an
inconvenient width, and will help clean up after SRoA.  See also "Adding 
legal integer sizes to TargetData" on Feb 1, 2009 on llvmdev, and PR3451.

Comments welcome.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86370 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-07 09:35:34 +00:00
Chris Lattner
2e07494170 more cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86369 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-07 09:23:04 +00:00
Chris Lattner
b7aadfac5e rewrite TargetData to use StringRef/raw_ostream instead of thrashing std::strings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86366 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-07 09:13:23 +00:00
Jeffrey Yasskin
2d274412ed Make the need-stub variables accurate and consistent. In the case of
MachineRelocations, "stub" always refers to a far-call stub or a
load-a-faraway-global stub, so this patch adds "Far" to the term. (Other stubs
are used for lazy compilation and dlsym address replacement.) The variable was
also inconsistent between the positive and negative sense, and the positive
sense ("NeedStub") was more demanding than is accurate (since a nearby-enough
function can be called directly even if the platform often requires a stub).
Since the negative sense causes double-negatives, I switched to
"MayNeedFarStub" globally.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86363 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-07 08:51:52 +00:00
Mikhail Glushenkov
6533afe349 llvmc: Add a '-time' option.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86348 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-07 06:33:58 +00:00
Mikhail Glushenkov
4e2211112e 80-col violation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86346 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-07 06:33:01 +00:00
Lang Hames
d6ef7fac1a Update some globals to use ManagedStatic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86342 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-07 05:50:28 +00:00
Evan Cheng
12749db150 Missed this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86331 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-07 04:07:30 +00:00
Kenneth Uildriks
b4997aeab7 Add code to check at SelectionDAGISel::LowerArguments time to see if return values can be lowered to registers. Coming soon, code to perform sret-demotion if return values cannot be lowered to registers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86324 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-07 02:11:54 +00:00
Jakob Stoklund Olesen
3de23e6f6c Fix inverted conflict test in -early-coalesce.
A non-identity copy cannot be coalesced when the phi join destination register
is live at the copy site.

Also verify the condition that the PHI join source register is only used in
the PHI join. Otherwise the coalescing is invalid.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86322 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-07 01:58:40 +00:00