Commit Graph

34429 Commits

Author SHA1 Message Date
Dan Gohman
87bad707ed Remove old DBG_LABEL code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90669 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 17:56:26 +00:00
Dan Gohman
714efc63d4 Remove the unused DisableLegalizeTypes option and related code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90668 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 17:51:33 +00:00
Bill Wendling
740266269b Calling InvalidateEntry during the refinement was breaking the bootstrap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90656 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 07:59:04 +00:00
Bill Wendling
32bc2362a1 Final cleanups:
- Privatize a typedef.
- Call the InvalidateEntry when refining a type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90655 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 07:46:49 +00:00
Bill Wendling
dc492e0370 Temporarily revert r90502. It was causing the llvm-gcc bootstrap on PPC to fail.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90653 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 07:30:23 +00:00
Nick Lewycky
93d3311d1f Fix indentation in switch statement.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90650 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 06:37:24 +00:00
Nick Lewycky
83e8ec73e1 Generalize this optimization to work on equality comparisons between any two
integers that are constant except for a single bit (the same n-th bit in each).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90646 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 05:00:00 +00:00
Dan Gohman
b3b9821cde Don't print a space before the : between the file name and line number.
And separate the directory and file name with a '/'.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90641 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 02:00:34 +00:00
Bill Wendling
688da28687 Inline methods which are called only once.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90640 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 01:46:01 +00:00
Bill Wendling
5681689795 Refactor some code. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90639 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 01:43:33 +00:00
Dan Gohman
eecb9919a4 Print newlines after printing labels for debug info, so that the output
isn't cluttered with things like "Llabel47:Llabel48:  movq  (%rsi), %xmm3"


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90638 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 01:42:34 +00:00
Dan Gohman
381ca5572e Don't blindly set the debug location for PHI node copies.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90637 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 01:29:04 +00:00
Dan Gohman
6e3ff37547 Make TargetSelectInstruction protected and called from FastISel.cpp
instead of SelectionDAGISel.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90636 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 01:27:58 +00:00
Dan Gohman
864e2efce2 Remove the target hook TargetInstrInfo::BlockHasNoFallThrough in favor of
MachineBasicBlock::canFallThrough(), which is target-independent and more
thorough.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90634 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 00:44:40 +00:00
Dan Gohman
735985fbbe Simplify this code: don't call AnalyzeBranch before doing simpler checks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90633 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 00:32:59 +00:00
Dan Gohman
07f111e7b7 The debug information for an LLVM Instruction applies to that Instruction
and that Instruction only. Implement this by setting the "current debug position"
back to Unknown after processing each instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90632 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 00:27:08 +00:00
Dan Gohman
3b9bc04eda Fix this code to use DIScope instead of DICompileUnit, as in r90181.
Don't print "SrcLine"; just print the filename and line number, which
is obvious enough and more informative.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90631 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 00:23:29 +00:00
Dan Gohman
4b808b014b Don't print the debug directory; it's often long and uninteresting. Omit
the column number if it is not known. Handle the case of a missing filename
better.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90630 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 00:20:51 +00:00
David Greene
adbc23cae1 Remove an unneeded include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90625 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 23:55:07 +00:00
Dan Gohman
fcafe44f56 Print a space between the comment character and the text.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90621 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 23:19:55 +00:00
Devang Patel
d55224c25e In TAG_subrange_type, uppder bound is zero indexed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90617 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 23:10:24 +00:00
David Greene
f7ea2a534b Use new interfaces to print spill size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90611 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 22:46:04 +00:00
David Greene
29dbf50b18 Have hasLoad/StoreFrom/ToStackSlot return the relevant MachineMemOperand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90608 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 22:38:46 +00:00
Bob Wilson
39fdd6947c Fix up some comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90603 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 21:57:37 +00:00
Bob Wilson
d614a1f0a8 Fix 80-column violations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90601 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 21:51:35 +00:00
Bill Wendling
1500c4f49a Some code cleanup. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90588 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 21:03:02 +00:00
Victor Hernandez
ff7707e983 Avoid creating a metadata slot for all metadata that contains an instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90581 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 20:07:10 +00:00
Evan Cheng
11572babb1 Handle recursive PHI's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90575 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 19:09:10 +00:00
Victor Hernandez
954c80e99d Fix crasher when N->getElement(n) is NULL
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90572 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 18:29:23 +00:00
Evan Cheng
79fc6f44b6 Add a pre-regalloc tail duplication pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90567 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 09:42:45 +00:00
Evan Cheng
9d0f8bba17 Don't try to be cute with undef optimization here. Let ProcessImplicitDefs handle it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90566 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 09:23:37 +00:00
Duncan Sands
36236b76a4 Add note about a subtle bug in this code. Does not effect the main
architectures that LLVM targets, because they don't use this code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90564 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 08:42:17 +00:00
Daniel Dunbar
83563b24ce Fix typo and add missing include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90557 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 08:17:07 +00:00
Andreas Neustifter
1f6ae81725 Added debug output for inherited passes that are invalidated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90553 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 06:58:24 +00:00
Chris Lattner
44a7a380aa Fix PR5551 by not ignoring the top level constantexpr when
folding a load from constant.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90545 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 06:29:29 +00:00
Chris Lattner
bbf9a5845a add to cmake
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90539 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 04:15:36 +00:00
Chris Lattner
210e45af3a add the start of a class used to handle phi translation in memdep and
gvn (this is just a skeleton so far).  This will ultimately be used
to fix a nasty miscompilation with GVN.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90518 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 02:10:16 +00:00
Victor Hernandez
97e2450de2 Teach AsmWriter to write inline (not via a global metadata slot) metadata that contains an instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90512 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 01:35:02 +00:00
Bob Wilson
eb35699e64 Fix a comment typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90511 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 01:33:04 +00:00
Chris Lattner
45305d4ff6 add an assert to make it really clear what this is doing. Return singularval as
a compile time perf optimization to avoid a load.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90507 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 01:03:32 +00:00
Jakob Stoklund Olesen
6b74e505be Also attempt trivial coalescing for live intervals that end in a copy.
The coalescer is supposed to clean these up, but when setting up parameters
for a function call, there may be copies to physregs. If the defining
instruction has been LICM'ed far away, the coalescer won't touch it.

The register allocation hint does not always work - when the register
allocator is backtracking, it clears the hints.

This patch takes care of a few more cases that r90163 missed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90502 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 00:16:04 +00:00
Evan Cheng
2e65c29ac6 - If the reaching definition is an undef and the use is a PHI, add the implicit_def to the end of the source block.
- When reaching value is replaced with another, update the cache as well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90501 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 00:09:05 +00:00
Devang Patel
b3235d22e9 Insert composite type DIE into the map before processing type fields. This allows fields to find their context DIE from the map.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90498 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 23:46:57 +00:00
Victor Hernandez
1971556cc2 Add ParseInlineMetadata() which can parses metadata that refers to an instruction. Extend ParseParameterList() to use this new function so that calls to llvm.dbg.declare can pass inline metadata
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90497 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 23:40:58 +00:00
Jim Grosbach
4dc4a61c0c remove out of date FIXME.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90490 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 21:55:01 +00:00
Evan Cheng
01306cad01 Handle undef values properly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90489 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 21:51:55 +00:00
Evan Cheng
9aed9396a6 Watch out for PHI instruction with no source operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90488 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 21:50:58 +00:00
Bob Wilson
4a8ee23a81 Fix a comment typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90487 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 21:47:07 +00:00
Duncan Sands
9993b88f06 Fix ExpandShiftWithUnknownAmountBit, which was completely bogus.
Pointed out by Javier Martinez (who also provided a patch).  Since
this logic is not used on (for example) x86, I guess nobody noticed.
Tested by generating SHL, SRL, SRA on various choices of i64 for all
possible shift amounts, and comparing with gcc.  Since I did this on
x86-32, I had to force the use of ExpandShiftWithUnknownAmountBit.
What I'm saying here is that I don't have a testcase I can add to the
repository.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90482 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 21:37:32 +00:00
Jakob Stoklund Olesen
f4811a9694 Clean up some loop logic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90481 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 20:49:10 +00:00
Devang Patel
5d11eb0ed5 Add support to emit debug info for virtual functions and virtual base classes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90474 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 19:11:07 +00:00
Dan Gohman
018402d30c Print a newline after the Args: line so that unrelated errs() output doesn't
end up on the same line.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90473 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 19:03:18 +00:00
Benjamin Kramer
88a91b579b Fix MSVC build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90454 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 13:23:03 +00:00
Andreas Neustifter
8c30abec6d Convert ProfileVerifier to template so it can be used for different types of ProfileInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90451 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 12:55:57 +00:00
Andreas Neustifter
1640f7e033 Do not create negative edge weights in ProfileEstimator.
Use integer values for weights to prevent rounding errors.
Make ProfileEstimator more robust in general CFGs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90449 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 12:41:14 +00:00
Daniel Dunbar
a6d5e40e25 Add an implementation of the delta debugging algorithm.
- This is a pretty slow / memory intensive implementation, and I will likely
   change it to an iterative model, but it works.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90447 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 11:12:42 +00:00
Andreas Neustifter
44299c9507 Use ProfileInfo-API in ProfileInfo Loader and do more assertions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90446 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 11:00:37 +00:00
Andreas Neustifter
e2baf6b455 Converted ProfileInfo to template, added more API for ProfileInfo-preserving.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90445 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 09:30:12 +00:00
Evan Cheng
111e7629cc Teach tail duplication to update SSA form. Work in progress.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90432 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 08:43:53 +00:00
Chris Lattner
89742c2c3f expand note.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90429 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 07:43:46 +00:00
Chris Lattner
053321731c add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90428 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 07:41:54 +00:00
Nate Begeman
93e0ed31c5 Don't pull vector sext through both hands of a logical operation, since doing so prevents the fusion of vector sext and setcc into vsetcc.
Add a testcase for the above transformation.
Fix a bogus use of APInt noticed while tracking this down.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90423 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 07:11:29 +00:00
Chris Lattner
56856b1f46 fix a build problem with VC++, PR5664, patch by Alp Toker!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90419 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 06:58:32 +00:00
Bob Wilson
324f4f1633 Recognize canonical forms of vector shuffles where the same vector is used for
both source operands.  In the canonical form, the 2nd operand is changed to an
undef and the shuffle mask is adjusted to only reference elements from the 1st
operand.  Radar 7434842.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90417 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 06:40:55 +00:00
Jakob Stoklund Olesen
9f0d4e631d Don't call getValueType() on a null SDValue
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90415 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 05:15:35 +00:00
Owen Anderson
c9f2027adb Fix this crasher, and add a FIXME for a missed optimization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90408 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 03:43:29 +00:00
Evan Cheng
229694f0ee Fill out codegen SSA updater. It's not yet tested.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90395 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 02:31:43 +00:00
Bill Wendling
cb06403145 Revert r90371. It was causing build failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90383 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 01:54:07 +00:00
Jakob Stoklund Olesen
15d75d9f11 Don't hang on to pointers or references after vector::push_back.
The MO reference to a MachineOperand can be invalidated by
MachineInstr::addOperand. Don't even use it for debugging.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90381 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 01:49:56 +00:00
Devang Patel
1d5cc1db59 Emit method definition DIE at module level (even for methods with inlined functino body at soure level) so that the debugger can invoke it. This fixes many test failures in gdb test suite.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90375 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 01:25:38 +00:00
Bill Wendling
b8e675c3c1 Further improvements: refactoring code that does the same thing into one
function, converting "dyn_cast" to "cast", asserting the correct things, and
other general cleanups.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90371 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 01:15:46 +00:00
Chris Lattner
bf108bdee5 yay for case insensitive file systems (?)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90370 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 01:10:05 +00:00
Chris Lattner
e568fa2d29 fix PR5673 by being more careful about pointers to functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90369 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 01:05:45 +00:00
Chris Lattner
35e86af8e5 remove some dead std::ostream using code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90366 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 00:55:04 +00:00
Chris Lattner
7896c9f436 improve portability to avoid conflicting with std::next in c++'0x.
Patch by Howard Hinnant!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90365 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 00:50:42 +00:00
Bill Wendling
dd5eb02304 This initial code is meant to convert TargetData to use an AbstractTypesUser so
that it doesn't have dangling pointers when abstract types are resolved. This
modifies it somewhat to address comments: making the "StructLayoutMap" an
anonymous structure, calling "removeAbstractTypeUser" when appropriate, and
adding asserts where helpful.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90362 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 00:17:12 +00:00
Douglas Gregor
e731fa2957 Fix CMake makefiles
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90354 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 22:19:31 +00:00
Evan Cheng
651ea5376c Skeleton for MachineInstr level SSA updater.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90353 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 22:02:52 +00:00
Jim Grosbach
b51d3f9c8d Add MaxStackAlignment.cpp to CMake
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90337 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 19:31:07 +00:00
Jim Grosbach
e27d205d5d Factor the stack alignment calculations out into a target independent pass.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90336 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 19:30:24 +00:00
Bob Wilson
f1e01dcc94 Don't count PHI instructions toward the limit for tail duplicating a block.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90326 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 17:15:24 +00:00
Jim Grosbach
43a8241b65 Move EliminateDuplicatePHINodes() from SimplifyCFG.cpp to Local.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90324 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 17:06:45 +00:00
Andreas Neustifter
059a983531 Cheap, mostly strict, stable sorting.
This is necessary for tests so the results are comparable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90320 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 15:57:15 +00:00
Benjamin Kramer
0fea11a805 Silence compiler warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90319 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 15:33:44 +00:00
Devang Patel
69f57b1f41 Clarify that DIEString does not keep a copy of the string.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90318 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 15:25:16 +00:00
Owen Anderson
9ff5a23186 Cleanup/remove some parts of the lifetime region handling code in memdep and GVN,
per Chris' comments.  Adjust testcases to match.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90304 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 07:35:19 +00:00
Chris Lattner
720e790480 factor some code better.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90299 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 06:44:58 +00:00
Chris Lattner
65a9ab4f8f formatting cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90298 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 06:35:55 +00:00
Chris Lattner
bf796323b2 tidy up, remove dependence on order of evaluation of function args from EmitMemCpy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90297 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 06:05:42 +00:00
Mon P Wang
69a008075b Fixed an assertion failure for tracking sext of a vector of integers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90290 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 04:59:58 +00:00
Devang Patel
e3a18de4f6 Add utility routine to create subprogram definition entry from subprogram declaration entry.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90282 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 23:09:02 +00:00
Devang Patel
7d0750a10f Reuse existing subprogram DIE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90281 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 23:07:59 +00:00
Chris Lattner
6e1f16d522 return more useful error messages by using strerror to format errno
instead of returning an ambiguous reason.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90275 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 22:51:41 +00:00
Evan Cheng
9836a26da3 Fix PR5391: support early clobber physical register def tied with a use (ewwww)
- A valno should be set HasRedefByEC if there is an early clobber def in the middle of its live ranges. It should not be set if the def of the valno is defined by an early clobber.
- If a physical register def is tied to an use and it's an early clobber, it just means the HasRedefByEC is set since it's still one continuous live range.
- Add a couple of missing checks for HasRedefByEC in the coalescer. In general, it should not coalesce a vr with a physical register if the physical register has a early clobber def somewhere. This is overly conservative but that's the price for using such a nasty inline asm "feature".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90269 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 22:25:00 +00:00
Chris Lattner
1e8de49fe7 rename some variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90258 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 21:16:01 +00:00
Chris Lattner
1ffb70f21d tidy
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90257 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 21:15:15 +00:00
Dan Gohman
5b69fe767c Add edge source labels to SelectionDAG graphs, now that the graph printing
framework omits differentiated edge sources in the case where the labels
are empty strings.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90254 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 19:20:00 +00:00
Dan Gohman
0baf2a302f Minor cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90253 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 19:16:15 +00:00
Dan Gohman
241c595786 Trim an unnecessary #include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90252 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 19:13:27 +00:00
Devang Patel
c09ddc1c79 Clear function specific containers while processing end of a function, even if DW_TAG_subprogram for current function is not found.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90247 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 18:13:48 +00:00
Jim Grosbach
d122874996 Thumb1 exception handling setjmp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90246 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 18:10:36 +00:00
Johnny Chen
b731e87649 For VLDM/VSTM (Advanced SIMD), set encoding bits Inst{11-8} to 0b1011.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90243 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 17:37:06 +00:00
Jakob Stoklund Olesen
8f72235a77 Move PHIElimination::isLiveOut method to LiveVariables.
We want LiveVariables clients to use methods rather than accessing the
getVarInfo data structure directly. That way it will be possible to change the
LiveVariables representation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90240 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 17:13:31 +00:00
Chris Lattner
855d9da596 fix 255.vortex again, third time's the charm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90217 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 07:33:32 +00:00
Chris Lattner
46875c0bfb fix PR5640 by tracking whether a block is the header of a loop more
precisely, which prevents us from infinitely peeling the loop.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90211 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 06:04:43 +00:00
Jakob Stoklund Olesen
579d6d9fe3 Use CFG connectedness as a secondary sort key when deciding the order of copy coalescing.
This means that well connected blocks are copy coalesced before the less connected blocks. Connected blocks are more difficult to
coalesce because intervals are more complicated, so handling them first gives a greater chance of success.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90194 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 03:03:00 +00:00
Dan Gohman
261a7d983d Devang pointed out that this code should use DIScope instead of
DICompileUnit. This code now prints debug filenames successfully.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90181 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 00:45:56 +00:00
Evan Cheng
a4025df42d Fix PR5614: parts of a physical register def may be killed the rest.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90180 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 00:44:45 +00:00
Johnny Chen
208d76cad9 For VMOV (immediate), make some of the encoding bits (cmode and op) unspecified.
For VMOVv*i[16,32], op bit is don't care, and some cmode bits vary depending on
the immediate values.

Ref: Table A7-15 Modified immediate values for Advanced SIMD instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90173 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 00:02:02 +00:00
Devang Patel
deea564e53 If pointer type has a name then do not ignore the name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90172 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 23:56:56 +00:00
Dan Gohman
39a1fab856 Minor whitespace fixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90166 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 23:33:53 +00:00
Dan Gohman
22f6526081 Fix a minor inconsistency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90165 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 23:33:37 +00:00
Jakob Stoklund Olesen
ce7a663140 New virtual registers created for spill intervals should inherit allocation hints from the original register.
This helps us avoid silly copies when rematting values that are copied to a physical register:

leaq	_.str44(%rip), %rcx
movq	%rcx, %rsi
call	_strcmp

becomes:

leaq	_.str44(%rip), %rsi
call	_strcmp

The coalescer will not touch the movq because that would tie down the physical register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90163 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 22:55:54 +00:00
Bob Wilson
3858225afc Reprioritize tests for tail duplication to be aggressive about indirect
branches even when optimizing for code size.  Unless we find evidence to the
contrary in the future, the special treatment for indirect branches does not
have a significant effect on code size, and performance still matters with -Os.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90147 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 18:56:45 +00:00
Bob Wilson
15217e63bc Remove isProfitableToDuplicateIndirectBranch target hook. It is profitable
for all the processors where I have tried it, and even when it might not help
performance, the cost is quite low.  The opportunities for duplicating
indirect branches are limited by other factors so code size does not change
much due to tail duplicating indirect branches aggressively.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90144 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 18:35:03 +00:00
Bob Wilson
afa1df467b Fix some more ARM unified syntax warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90141 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 17:47:19 +00:00
Tobias Grosser
ab01069fcd Fix last DOTGraphTraits problems in CompilationGraph.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90136 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 13:34:51 +00:00
Tobias Grosser
b5eedf2c1c Remove forgotten ShortNames in Trie and CompilationGraph
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90135 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 13:14:13 +00:00
Tobias Grosser
56f4ef3232 Remove ShortNames from getNodeLabel in DOTGraphTraits
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90134 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 12:38:47 +00:00
Tobias Grosser
a10d598602 Instantiate DefaultDOTGraphTraits
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90133 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 12:38:13 +00:00
Tobias Grosser
2833fac273 Small PostDominatorTree improvements
* Do not SEGFAULT if tree entryNode() is NULL
 * Print function names in dotty printer

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90130 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 12:06:37 +00:00
Nick Lewycky
f58e86d762 Revert r90107, fixing test/Transforms/GVN/2009-11-29-ReverseMap.ll and the
llvm-gcc build.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90113 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 07:05:51 +00:00
Mon P Wang
cd6e725f21 Added support to allow clients to custom widen. For X86, custom widen vectors for
divide/remainder since these operations can trap by unroll them and adding undefs
for the resulting vector.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90108 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 02:42:02 +00:00
Chris Lattner
366429b400 reapply r90093 with an addition of keeping the forward
and reverse nonlocal memdep maps in synch, this should
fix 255.vortex.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90107 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 02:26:29 +00:00
Nick Lewycky
fac554a131 Teach ConstantFolding to do a better job when folding gep(bitcast).
This permits the devirtualization of llvm.org/PR3100#c9 when compiled by clang.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90099 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-29 21:40:55 +00:00
Benjamin Kramer
e6f329476c Revert r90089 for now, it's breaking selfhost.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90097 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-29 21:17:48 +00:00
Chris Lattner
ae3d24880d revert this patch for now, it causes failures of:
LLVM::Transforms/GVN/2009-02-17-LoadPRECrash.ll
    LLVM::Transforms/GVN/2009-06-17-InvalidPRE.ll



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90096 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-29 21:14:59 +00:00
Chris Lattner
1903d97c2c Fix a really nasty caching bug I introduced in memdep. An entry
was being added to the Result vector, but not being put in the
cache.  This means that if the cache was reused wholesale for a
later query that it would be missing this entry and we'd do an
incorrect load elimination.

Unfortunately, it's not really possible to write a useful 
testcase for this, but this unbreaks 255.vortex.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90093 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-29 21:09:36 +00:00
Benjamin Kramer
4aac07e898 Fix two FIXMEs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90089 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-29 20:29:30 +00:00
Nick Lewycky
2eac9493fc Detabify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90085 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-29 18:10:39 +00:00
Benjamin Kramer
18eaefd25e Remove dead returns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90083 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-29 17:42:58 +00:00
Kovarththanan Rajaratnam
d614673bb8 This patch ensures that Path::GetMainExecutable is able to handle the
case where realpath() fails. When this occurs we segfault trying to
create a std::string from a NULL pointer.

Fixes PR5635.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90082 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-29 17:19:48 +00:00
Chris Lattner
cd188e9665 add testcases for the foo_with_overflow op xforms added recently and
fix bugs exposed by the tests.  Testcases from Alastair Lynn!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90056 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-29 02:57:29 +00:00
Chris Lattner
d4137f40da update and consolidate the load pre notes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90050 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-29 02:19:52 +00:00
Chris Lattner
3f40e23392 Implement PR5634.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90046 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-29 00:51:17 +00:00
Nick Lewycky
d801c10de6 Teach memdep to look for memory use intrinsics during dependency queries. Fixes
PR5574.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90045 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-28 21:27:49 +00:00
Chris Lattner
0c264b16b0 reenable load address insertion in load pre. This allows us to
handle cases like this:
void test(int N, double* G) {
  long j;
  for (j = 1; j < N - 1; j++)
      G[j+1] = G[j] + G[j+1];
}

where G[1] isn't live into the loop.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90041 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-28 16:08:18 +00:00
Chris Lattner
dd696052f0 Enhance InsertPHITranslatedPointer to be able to return a list of newly
inserted instructions.  No functionality change until someone starts using it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90039 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-28 15:39:14 +00:00
Chris Lattner
ab9530ee5d implement a FIXME: limit the depth that DecomposeGEPExpression goes the same
way that getUnderlyingObject does it. 

This fixes the 'DecomposeGEPExpression and getUnderlyingObject disagree!' 
assertion on sqlite3.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90038 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-28 15:12:41 +00:00
Chris Lattner
af7a28939e enable code to handle un-phi-translatable cases more aggressively:
if we don't have an address expression available in a predecessor,
then model this as the value being clobbered at the end of the pred
block instead of being modeled as a complete phi translation failure.
This is important for PRE of loads because we want to see that the
load is available in all but this predecessor, and complete phi
translation failure results in not getting any information about
predecessors.

This doesn't do anything until I renable code insertion since PRE
now sees that it is available in all but one predecessors, but can't
insert the addressing in the predecessor that is missing it to 
eliminate the redundancy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90037 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-28 14:54:10 +00:00
Chris Lattner
971fd57f7d disable value insertion for now, I need to figure out how
to inform GVN about the newly inserted values.  This fixes 
PR5631.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90022 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-27 22:50:07 +00:00
Chris Lattner
6f7b210b25 Rework InsertPHITranslatedPointer to handle the recursive case, this
fixes PR5630 and sets the stage for the next phase of goodness (testcase
pending).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90019 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-27 22:05:15 +00:00
Chris Lattner
5141421e38 recursively phi translate bitcast operands too, for consistency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90016 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-27 20:25:30 +00:00
Nick Lewycky
807d2fa1eb Oops! Fix bug introduced in my recent cleanup change. Thanks to Tobias Grosser
for pointing this out.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90015 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-27 19:57:53 +00:00
Chris Lattner
11c6bab704 add support for recursive phi translation and phi
translation of add with immediate.  This allows us
to optimize this function:

void test(int N, double* G) {
  long j;
  G[1] = 1;
    for (j = 1; j < N - 1; j++)
        G[j+1] = G[j] + G[j+1];
}

to only do one load every iteration of the loop.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90013 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-27 19:11:31 +00:00
Chris Lattner
8aee8efc0c factor some logic out of instcombine into a new SimplifyAddInst method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90011 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-27 17:42:22 +00:00
Chris Lattner
1d159838a3 add a deadargelim note.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90009 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-27 17:12:30 +00:00
Chris Lattner
6d94926a52 This testcase is actually only partially redundant, and requires
the FIXME I added yesterday to be implemented.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90008 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-27 16:53:57 +00:00
Chris Lattner
8976e5950f fix PR5436 by making the 'simple' case of SRoA not promote out of range
array indexes.  The "complex" case of SRoA still handles them, and correctly.

This fixes a weirdness where we'd correctly avoid transforming A[0][42] if
the 42 was too large, but we'd only do it if it was one gep, not two separate
ones.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90007 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-27 16:37:41 +00:00
Chris Lattner
9763487bd5 add comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90002 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-27 08:40:14 +00:00
Chris Lattner
e95035aea4 reduce nesting, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90001 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-27 08:37:22 +00:00
Chris Lattner
a650f770d4 limit the recursion depth of GetLinearExpression. This
fixes a crash analyzing consumer-lame, which had an "%X = add %X, 1"
in unreachable code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90000 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-27 08:32:52 +00:00
Chris Lattner
616613d7a4 teach GVN's load PRE to insert computations of the address in predecessors
where it is not available.  It's unclear how to get this inserted 
computation into GVN's scalar availability sets, Owen, help? :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89997 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-27 08:25:10 +00:00
Chris Lattner
62deff066c Fix phi translation in load PRE to agree with the phi
translation done by memdep, and reenable gep translation 
again.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89992 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-27 06:31:14 +00:00
Chris Lattner
b99be5beac redisable this, my bootstrap worked because it wasn't an optimized build, whoops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89991 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-27 05:53:01 +00:00
Chris Lattner
cca130bb66 try again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89990 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-27 05:19:56 +00:00
Chris Lattner
518c988ae9 this is causing buildbot failures, disable for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89985 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-27 01:52:22 +00:00
Chris Lattner
20ce7c0ded this (and probably several others) are now done.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89982 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-27 00:35:04 +00:00
Chris Lattner
e19e4baf3b teach phi translation of GEPs to simplify geps like 'gep x, 0'.
This allows us to compile the example from PR5313 into:

LBB1_2:                                                     ## %bb
	incl	%ecx
	movb	%al, (%rsi)
	movslq	%ecx, %rax
	movb	(%rdi,%rax), %al
	testb	%al, %al
	jne	LBB1_2

instead of:

LBB1_2:                                                     ## %bb
	movslq	%eax, %rcx
	incl	%eax
	movb	(%rdi,%rcx), %cl
	movb	%cl, (%rsi)
	movslq	%eax, %rcx
	cmpb	$0, (%rdi,%rcx)
	jne	LBB1_2



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89981 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-27 00:34:38 +00:00
Chris Lattner
c514c1f521 factor some instcombine simplifications for getelementptr out to a new
SimplifyGEPInst method in InstructionSimplify.h.  No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89980 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-27 00:29:05 +00:00
Chris Lattner
304076268a teach memdep to do trivial PHI translation of GEPs. More to
come.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89979 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-27 00:07:37 +00:00
Chris Lattner
cc3d0eb483 Teach memdep to phi translate bitcasts. This allows us to compile
the example in GCC PR16799 to:

LBB1_2:                                                     ## %bb1
	movl	%eax, %eax
	subq	%rax, %rdi
	movq	%rdi, (%rcx)
	movl	(%rdi), %eax
	testl	%eax, %eax
	je	LBB1_2

instead of:

LBB1_2:                                                     ## %bb1
	movl	(%rdi), %ecx
	subq	%rcx, %rdi
	movq	%rdi, (%rax)
	cmpl	$0, (%rdi)
	je	LBB1_2



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89978 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-26 23:41:07 +00:00
Nick Lewycky
dbee4b3be5 Fix typo spotted by Gabor Greif.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89976 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-26 23:19:05 +00:00
Chris Lattner
dc59311c5c factor some code out into some helper functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89975 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-26 23:18:49 +00:00
Nick Lewycky
2353122a3c Clean up file, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89974 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-26 22:54:26 +00:00
Chris Lattner
5bda3792b4 Add a hack for PR5601, a crash on obsolete syntax that we plan to
remove in LLVM 3.0


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89973 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-26 22:48:23 +00:00
Chris Lattner
998e25a143 fix crash on Transforms/InstCombine/intrinsics.ll introduced by r89970
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89972 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-26 22:08:06 +00:00
Chris Lattner
21f83a2f95 Fix PR5471 by removing an instcombine xform. Some pieces of the code
generates store to undef and some generates store to null as the idiom
for undefined behavior.  Since simplifycfg zaps both, don't remove the
undefined behavior in instcombine.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89971 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-26 22:04:42 +00:00
Chris Lattner
2bbac75e5a implement a bunch of xforms for overflow intrinsics, based on a patch
by Alastair Lynn.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89970 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-26 21:42:47 +00:00
Bob Wilson
2d521e51ac Rename new TailDuplicationPass to avoid name conflict with the old one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89968 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-26 21:38:41 +00:00
Chris Lattner
1ce0eaa25f Implement PR1143 (at -m64) by making basicaa look through extensions. We
previously already handled it at -m32 because there were no i32->i64 
extensions for addressing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89959 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-26 18:53:33 +00:00
Chris Lattner
b18004c13c fix two transposed lines duncan caught and add an explanatory comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89958 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-26 18:35:46 +00:00
Chris Lattner
8fe8ac725b this todo is resolved.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89957 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-26 17:14:10 +00:00
Chris Lattner
e405c64f6b move DecomposeGEPExpression out into ValueTracking.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89956 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-26 17:12:50 +00:00
Chris Lattner
fa3966881f teach GetLinearExpression to be a bit more aggressive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89955 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-26 17:00:01 +00:00
Chris Lattner
5369250b73 resolve a fixme. I haven't figured out how to write a testcase
to exercise this though.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89954 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-26 16:52:32 +00:00
Chris Lattner
5d5261c819 Teach basicaa that x|c == x+c when the c bits of x are clear. This
allows us to compile the example in readme.txt into:

LBB1_1:                                                     ## %bb
	movl	4(%rdx,%rax), %ecx
	movl	%ecx, %esi
	imull	(%rdx,%rax), %esi
	imull	%esi, %ecx
	movl	%esi, 8(%rdx,%rax)
	imull	%ecx, %esi
	movl	%ecx, 12(%rdx,%rax)
	movl	%esi, 16(%rdx,%rax)
	imull	%ecx, %esi
	movl	%esi, 20(%rdx,%rax)
	addq	$16, %rax
	cmpq	$4000, %rax
	jne	LBB1_1

instead of:

LBB1_1: 
	movl	(%rdx,%rax), %ecx
	imull	4(%rdx,%rax), %ecx
	movl	%ecx, 8(%rdx,%rax)
	imull	4(%rdx,%rax), %ecx
	movl	%ecx, 12(%rdx,%rax)
	imull	8(%rdx,%rax), %ecx
	movl	%ecx, 16(%rdx,%rax)
	imull	12(%rdx,%rax), %ecx
	movl	%ecx, 20(%rdx,%rax)
	addq	$16, %rax
	cmpq	$4000, %rax
	jne	LBB1_1

GCC (4.2) doesn't seem to be able to eliminate the loads in this 
testcase either, it generates:

L2:
	movl	(%rdx), %eax
	imull	4(%rdx), %eax
	movl	%eax, 8(%rdx)
	imull	4(%rdx), %eax
	movl	%eax, 12(%rdx)
	imull	8(%rdx), %eax
	movl	%eax, 16(%rdx)
	imull	12(%rdx), %eax
	movl	%eax, 20(%rdx)
	addl	$4, %ecx
	addq	$16, %rdx
	cmpl	$1002, %ecx
	jne	L2




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89952 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-26 16:26:43 +00:00
Chris Lattner
f6ac4d9dad teach basicaa that A[i] != A[i+1].
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89951 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-26 16:18:10 +00:00
Chris Lattner
d84eb911a9 Change the other half of aliasGEP (which handles GEP differencing) to use DecomposeGEPExpression. This dramatically simplifies and shrinks the code by eliminating the horrible CheckGEPInstructions method, fixes a miscompilation (@test3) and makes the code more aggressive. In particular, we now handle the @test4 case, which is reduced from the SmallPtrSet constructor. Missing this caused us to emit a variable length memset instead of a fixed size one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89922 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-26 02:17:34 +00:00
Chris Lattner
23e2a5b2ff Generalize DecomposeGEPExpression to exactly handle what Value::getUnderlyingObject does (when TD is around). This allows us to avoid calling DecomposeGEPExpression unless the ultimate alias check we care about passes, speedup up BasicAA a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89920 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-26 02:14:59 +00:00
Chris Lattner
4e91ee7a2a Implement a new DecomposeGEPExpression method, which decomposes a GEP into a list of scaled offsets. Use this to eliminate some previous ad-hoc code which was subtly broken (it assumed all Constant*'s were non-zero, but strange constant express could be zero).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89915 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-26 02:13:03 +00:00
Chris Lattner
539c9b99c2 Use GEPOperator more pervasively to simplify code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89914 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-26 02:11:08 +00:00
Chris Lattner
9c6a0dcf0e update some notes slightly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89913 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-26 01:51:18 +00:00
Chris Lattner
11fe72661d remove some redundant braces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89912 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-26 01:50:12 +00:00
Evan Cheng
40ea0e22b2 When all defs of a vr are implicit_def, delete all of the defs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89905 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-26 00:32:36 +00:00
Bob Wilson
15acadde5f Split tail duplication into a separate pass. This is needed to avoid
running tail duplication when doing branch folding for if-conversion, and
we also want to be able to run tail duplication earlier to fix some
reg alloc problems.  Move the CanFallThrough function from BranchFolding
to MachineBasicBlock so that it can be shared by TailDuplication.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89904 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-26 00:32:21 +00:00
Viktor Kutuzov
308f6630a3 Rollback changes r89516: Added two SubtargetFeatures::AddFeatures methods, which accept a comma-separated string or already parsed command line parameters as input, and some code re-factoring to use these new methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89893 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-25 22:44:18 +00:00
Evan Cheng
e7c9195706 ProcessImplicitDefs should watch out for invalidated iterator and extra implicit operands on copies.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89880 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-25 21:13:39 +00:00
Bob Wilson
de9b1dae37 Tail duplicate indirect branches for PowerPC, too.
With the testcase for pr3120, the "threaded interpreter" runtime decreases
from 1788 to 1413 with this change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89877 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-25 19:57:14 +00:00
Benjamin Kramer
1c3451fc99 Avoid some possibly unsafe uses of StringRef::data().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89873 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-25 18:26:09 +00:00
Devang Patel
65dbc909f5 Use StringRef (again) in DebugInfo interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89866 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-25 17:36:49 +00:00
Bob Wilson
4a66e5bfc2 Based on the testcase for pr3120, running on my MacPro with Xeon processors,
it is definitely profitable to tail duplicate indirect branches for x86.
This is likely to be true to various degrees for all modern x86 processors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89865 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-25 17:27:53 +00:00
Bruno Cardoso Lopes
d71cebf575 Support PIC loading of constant pool entries
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89863 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-25 12:17:58 +00:00
Daniel Dunbar
5f9b9efa17 Sketch structure for X86 disassembler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89850 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-25 06:53:08 +00:00
Edward O'Callaghan
e49a8e4db9 API change Path::isSpecialFile to Path::isRegularFile, improve semantics in regards to comments from 89765 post review.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89848 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-25 06:32:19 +00:00
Douglas Gregor
b3587cfb3b Perform explicit instantiations in the proper namespace, since Clang diagnoses this ill-formity.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89846 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-25 06:04:18 +00:00
Edward O'Callaghan
25798439da Reverting patch in revision 89758, initial attempt at fixing PR5373 has proven to be bogus.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89844 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-25 05:38:41 +00:00
Bruno Cardoso Lopes
37fd537544 Use endianess dependent offsets for load/store of doubles when
using two swc/lwc instead of sdc/ldc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89826 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-25 01:05:25 +00:00
Dale Johannesen
0106a0aafe Fix compiler warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89824 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-25 00:58:21 +00:00
Bruno Cardoso Lopes
5f222b18e3 Only include in the callee saved regs the sub registers to avoid
unnecessary save/restore.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89823 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-25 00:47:43 +00:00