Commit Graph

41617 Commits

Author SHA1 Message Date
Dan Gohman
d98d6203e4 Optimize conditional branches in X86FastISel. This replaces
sequences like this:
       sete    %al
       testb   %al, %al
       jne     LBB11_1
with this:
       je      LBB11_1


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56969 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-02 22:15:21 +00:00
Dan Gohman
6ade6f55a8 Add a new MachineBasicBlock utility function, isLayoutSuccessor, that
can be used when deciding if a block can transfer control to another
via a fall-through instead of a branch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56968 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-02 22:09:09 +00:00
Mikhail Glushenkov
e4a5ea3130 Build system tweaks to make it more convenient for the plugin authors.
Plugins can be now compiled in with a slight Makefile change.
For example, to compile the new Clang driver, use:

cd $LLVMC2_DIR
make TOOLNAME=ccc2 BUILTIN_PLUGINS=Clang

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56967 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-02 21:15:05 +00:00
Andrew Lenharth
88ab90b475 fix build gcc 4.3
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56965 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-02 20:15:08 +00:00
Owen Anderson
8481ee7f52 Use a multimap rather than a map for holding the list of copies to insert, so we don't lose copies when two of them have
the same source.  I don't know what I was thinking when I wrote this originally.
Note: There's probably a more efficient way to do this, but I need to think about it some more, and about what determinism
guarantees need to be present.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56964 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-02 19:40:33 +00:00
Dale Johannesen
48c1bc2ace Handle some 64-bit atomics on x86-32, some of the time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56963 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-02 18:53:47 +00:00
Bill Wendling
46f7a5ec1a Avoid name shadowing with E variable defined in for(). This was giving VC++
grief.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56961 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-02 18:39:11 +00:00
Devang Patel
8cedb8a975 Remove redundant check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56960 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-02 18:38:23 +00:00
Evan Cheng
b1290a6cc4 A Partitioned Boolean Quadratic Programming (PBQP) based register allocator.
Contributed by Lang Hames.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56959 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-02 18:29:27 +00:00
Oscar Fuentes
208ca6aa14 CMake: Added Host.cpp to lib/System/CMakeLists.txt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56957 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-02 17:39:29 +00:00
Daniel Dunbar
76dba94dfa Rename IRBuilder::IsNonNull -> IsNotNull in response to feedback.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56953 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-02 17:05:03 +00:00
Dan Gohman
d790a5ceee Fix a think-o in isSafeToMove. This fixes it from thinking that
volatile memory references are safe to move.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56948 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-02 15:04:30 +00:00
Dan Gohman
5bbee4b40a Work around an interaction between fast-isel and regalloc=local. The
local register allocator's physreg liveness doesn't recognize subregs,
so it doesn't know that defs of %ecx that are immediately followed by
uses of %cl aren't dead. This comes up due to the way fast-isel emits
shift instructions.

This is a temporary workaround. Arguably, local regalloc should
handle subreg references correctly. On the other hand, perhaps
fast-isel should use INSERT_SUBREG instead of just assigning to the
most convenient super-register of %cl when lowering shifts.

This fixes MultiSource/Benchmarks/MallocBench/espresso,
MultiSource/Applications/hexxagon, and others, under -fast.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56947 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-02 14:56:12 +00:00
Bill Wendling
5e249b4a14 "The original bug was a complaint that _mm_srli_si128 mis-compiled when passed
a constant vector ("{0x123, 0x456}" syntax).  The fix is to simplify the
_mm_srli_si128 macro, and  move the "* 8" from the macro into the compiler
back-end.  I can't change the existing __builtins because so many people are
using them :-(."
Patch by Stuart Hastings!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56944 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-02 05:56:52 +00:00
Daniel Dunbar
bb14672097 Add llvm::sys::{osName,osVersion} for retrieving operating system name
& version as strings.
 - Win32 code is untested.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56942 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-02 01:17:28 +00:00
Dan Gohman
0b3baaa7fb Disable fast-isel for this test, as it doesn't emit the same
number of instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56940 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-01 23:48:35 +00:00
Devang Patel
7c31085b1c Attributes noinline alwaysinline are incompatible
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56939 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-01 23:41:25 +00:00
Devang Patel
4ae641f4d1 Remove OptimizeForSize global. Use function attribute optsize.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56937 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-01 23:18:38 +00:00
Dan Gohman
dc756858f9 Enable FastISel by default (on x86 and x86-64) with the -fast option.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56930 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-01 20:39:19 +00:00
Chris Lattner
795daece23 add a new form of Type::dump that takes a module for type names,
patch provided by Tomas Lindquist Olsen!




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56929 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-01 20:16:19 +00:00
Dan Gohman
aeaf245db3 Make some implicit conversions explicit, to avoid compiler warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56927 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-01 19:58:59 +00:00
Dan Gohman
e7aa7baa76 Split this test and move it into target-specific directories.
This fixes failures on configurations that don't have one or the
other targets enabled.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56926 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-01 19:46:30 +00:00
Dan Gohman
6d4b052579 Split x86's ADJCALLSTACK instructions into 32-bit and 64-bit forms.
This allows the 64-bit forms to use+def RSP instead of ESP. This
doesn't fix any real bugs today, but it is more precise and it
makes the debug dumps on x86-64 look more consistent.

Also, add some comments describing the CALL instructions' physreg
operand uses and defs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56925 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-01 18:28:06 +00:00
Jim Grosbach
efd30ba798 Fix typo s/ther/there/
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56924 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-01 18:16:49 +00:00
Duncan Sands
5d0392c6b3 Factorize code: remove variants of "strip off
pointer bitcasts and GEP's", and centralize the
logic in Value::getUnderlyingObject.  The
difference with stripPointerCasts is that
stripPointerCasts only strips GEPs if all
indices are zero, while getUnderlyingObject
strips GEPs no matter what the indices are.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56922 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-01 15:25:41 +00:00
Dan Gohman
38ac062c2f Fold trivial two-operand tokenfactors where the operands are equal
immediately.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56921 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-01 15:11:19 +00:00
Dan Gohman
10b49489bf Don't prepend a space character for constants in Value::print.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56920 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-01 15:09:37 +00:00
Dan Gohman
929d3eb171 Fix typos in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56919 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-01 15:07:49 +00:00
Dan Gohman
e7891c705c nounwind-ify this test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56918 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-01 15:07:14 +00:00
Nuno Lopes
86364023e6 revert the addition of Preverves(CallGraph), per Duncan's comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56917 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-01 09:13:40 +00:00
Dan Gohman
2662d55866 Mark CALL instructions as having a Use of ESP/RSP.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56911 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-01 04:14:30 +00:00
Dan Gohman
e4c38bac31 Don't leave an output file in the test directory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56910 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-01 04:13:23 +00:00
Dan Gohman
586b7b7547 Call ScalarEvolution's deleteValueFromRecords before deleting an
instruction, not after. This fixes some uses of free'd memory.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56908 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-01 02:02:03 +00:00
Bill Wendling
ae595dc9da Moved this option to the front-end.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56901 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-01 01:02:18 +00:00
Bill Wendling
6158d8492c Implement the -fno-builtin option in the front-end, not in the back-end.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56900 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-01 00:59:58 +00:00
Dan Gohman
70695fee51 Use explicit target-triples to unbreak this test on non-darwin systems.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56896 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-01 00:25:38 +00:00
Owen Anderson
05472ee54b Mark merged-in VNInfo's as being PHIKilled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56893 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-30 23:58:47 +00:00
Owen Anderson
309c6162c6 Fix a simple error in renumbering kill markaers, that took an inordinant amount of time to track down.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56889 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-30 22:51:54 +00:00
Bill Wendling
6e08738d4b Just don't transform this memset into "bzero" if no-builtin is specified.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56888 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-30 22:05:33 +00:00
Nuno Lopes
0483d018c4 add preserversCFG() + preservers(CallGraph)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56887 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-30 22:04:30 +00:00
Bill Wendling
fd8ca5a0ef - Initialize "--no-builtin" to "false".
- Testcase for r56885.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56886 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-30 21:40:30 +00:00
Bill Wendling
6f287b22d2 Add the new `-no-builtin' flag. This flag is meant to mimic the GCC
`-fno-builtin' flag. Currently, it's used to replace "memset" with "_bzero"
instead of "__bzero" on Darwin10+. This arguably violates the meaning of this
flag, but is currently sufficient. The meaning of this flag should become more
specific over time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56885 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-30 21:22:07 +00:00
Dan Gohman
5ec9efd61b Move the primary fast-isel top-level comments to FastISel.cpp, where
they'll be a little more visible. Also, update and reword them a bit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56877 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-30 20:48:29 +00:00
Nuno Lopes
dd7c3e4e56 add AU.setPreservesCFG() since this pass only adds and removes function attributes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56868 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-30 18:34:38 +00:00
Dan Gohman
f06c835f76 Optimize SelectionDAG's AssignTopologicalOrder even further.
Completely eliminate the TopOrder std::vector. Instead, sort
the AllNodes list in place. This also eliminates the need to
call AllNodes.size(), a linear-time operation, before
performing the sort.

Also, eliminate the Sources temporary std::vector, since it
essentially duplicates the sorted result as it is being
built.

This also changes the direction of the topological sort
from bottom-up to top-down. The AllNodes list starts out in
roughly top-down order, so this reduces the amount of
reordering needed. Top-down is also more convenient for
Legalize, and ISel needed only minor adjustments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56867 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-30 18:30:35 +00:00
Nuno Lopes
21420dfae1 ignore generated files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56866 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-30 18:15:04 +00:00
Evan Cheng
18314dc741 Add runStaticConstructorsDestructors which runs ctors / dtors of a single module. Patch by David Chisnall.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56849 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-30 15:51:21 +00:00
Evan Cheng
dc37786595 Re-apply 56835 along with header file changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56848 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-30 15:44:16 +00:00
Duncan Sands
f3b23188d5 Stacker is dead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56844 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-30 15:18:29 +00:00
Duncan Sands
46292be362 Revert commit 56835 since it breaks the build.
"If a re-materializable instruction has a register
operand, the spiller will change the register operand's
spill weight to HUGE_VAL to avoid it being spilled.
However, if the operand is already in the queue ready
to be spilled, avoid re-materializing it".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56837 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-30 10:00:30 +00:00