Commit Graph

41573 Commits

Author SHA1 Message Date
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
Evan Cheng
d41474d2c0 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@56835 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-30 06:36:58 +00:00
Nick Lewycky
a06cf82a7b Fix misoptimization of: xor i1 (icmp eq (X, C1), icmp s[lg]t (X, C2))
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56834 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-30 06:08:34 +00:00
Dan Gohman
5396c99baa Fix X86FastISel's output for x86-32 PIC constant pool addresses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56829 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-30 01:21:32 +00:00
Dan Gohman
57c3dac0df Move the GlobalBaseReg field out of X86ISelDAGToDAG.cpp
and X86FastISel.cpp into X86MachineFunction.h, so that it
can be shared, instead of having each selector keep track
of its own.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56825 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-30 00:58:23 +00:00
Dan Gohman
9b66d73bb1 Disable all x87 usage, including f32 and f64 when the subtarget
doesn't have SSE(2), with X86FastISel.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56823 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-30 00:48:39 +00:00
Dale Johannesen
71d1bf55a2 Remove misuse of ReplaceNodeResults for atomics with
valid types.  No functional change.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56808 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-29 22:25:26 +00:00
Dan Gohman
a43abd102f Fix FastISel to not initialize the PIC-base register multiple times
in functions with PIC references from more than one basic block.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56807 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-29 21:55:50 +00:00
Dan Gohman
7962e856d1 Fix an over-pessimization about GlobalVariable addresses in X86FastISel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56802 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-29 21:13:15 +00:00
Devang Patel
652203f3f3 Support inreg, zext and sext as return value attributes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56801 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-29 20:49:50 +00:00
Devang Patel
66c6c65de2 Fix grammar.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56796 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-29 18:34:44 +00:00
Devang Patel
c580144f41 Fix grammer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56795 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-29 18:16:38 +00:00
Devang Patel
12602059a1 Fix sentence.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56794 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-29 18:16:09 +00:00
Evan Cheng
d47e0b664f Fix PR2835. Do not change the width of a volatile load.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56792 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-29 17:26:18 +00:00
Duncan Sands
6cccf03d02 Speed up these passes when the callgraph has
huge simply connected components.  Suggested
by Chris.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56787 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-29 14:59:04 +00:00
Nuno Lopes
5ed3b894c9 remove redundant test (mayBeOverriden() includes hasLinkOnceLinkage)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56786 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-29 14:40:32 +00:00
Duncan Sands
224c86ee77 Tweak some comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56784 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-29 13:35:31 +00:00
Matthijs Kooijman
6aa812704f Add some hands-on documentation about which files to create and edit when
adding a backend.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56783 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-29 11:52:22 +00:00
Duncan Sands
5df3186f59 Rename isWeakForLinker to mayBeOverridden. Use it
instead of hasWeakLinkage in a bunch of optimization
passes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56782 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-29 11:25:42 +00:00
Matthijs Kooijman
7ab5799f75 Add a testcase showing that scalarrepl supports first class structs.
I originally made this script to show that scalarrepl didn't support them, but
it turned out it does. Better to still add the testcase then.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56781 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-29 10:42:13 +00:00
Dan Gohman
31bd42bc63 Move the code that handles DAGISel error conditions into
helper functions instead of duplicating it inline each time
it is needed. This eliminates a few hundred or so copies
of this code in each target.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56759 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-27 23:53:14 +00:00
Daniel Dunbar
7a3ec1e148 Add IRBuilder::{CreateIsNull, CreateIsNonNull} helper methods.
- I'm open to the idea that these could have better names. I think
   these read better than CreateEQNull and CreateNENull.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56757 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-27 23:22:55 +00:00
Evan Cheng
184793fc8a Re-apply 56683 with fixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56748 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-27 01:56:22 +00:00
Devang Patel
8526390768 Update tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56730 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-27 00:25:28 +00:00
Daniel Dunbar
02a4da2c22 Unbreak build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56727 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-27 00:22:09 +00:00
Bill Wendling
0b3c079cd5 Add missing #include for asserts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56718 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-27 00:08:24 +00:00
Devang Patel
2c9c3e7368 Implement function notes as function attributes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56716 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26 23:51:19 +00:00
Dale Johannesen
e7261863c5 Generated files for warning fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56715 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26 23:46:20 +00:00
Dale Johannesen
4598a4ece8 Fix a compiler warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56714 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26 23:45:53 +00:00
Evan Cheng
b7a75a5a54 Implement "punpckldq %xmm0, $xmm0" as "pshufd $0x50, %xmm0, %xmm" unless optimizing for code size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56711 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26 23:41:32 +00:00
Devang Patel
19c874638d Now Attributes are divided in three groups
- return attributes - inreg, zext and sext
- parameter attributes
- function attributes - nounwind, readonly, readnone, noreturn

Return attributes use 0 as the index.
Function attributes use ~0U as the index.

This patch requires corresponding changes in llvm-gcc and clang.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56704 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26 22:53:05 +00:00
Bill Wendling
d5d8191b20 Temporarily reverting r56683. This is causing a failure during the build of llvm-gcc:
/Volumes/Gir/devel/llvm/clean/llvm-gcc.obj/./gcc/xgcc -B/Volumes/Gir/devel/llvm/clean/llvm-gcc.obj/./gcc/ -B/Volumes/Gir/devel/llvm/clean/llvm-gcc.install/i386-apple-darwin9.5.0/bin/ -B/Volumes/Gir/devel/llvm/clean/llvm-gcc.install/i386-apple-darwin9.5.0/lib/ -isystem /Volumes/Gir/devel/llvm/clean/llvm-gcc.install/i386-apple-darwin9.5.0/include -isystem /Volumes/Gir/devel/llvm/clean/llvm-gcc.install/i386-apple-darwin9.5.0/sys-include -mmacosx-version-min=10.4 -O2  -O2 -g -O2  -DIN_GCC    -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -fPIC -pipe -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED  -I. -I. -I../../llvm-gcc.src/gcc -I../../llvm-gcc.src/gcc/. -I../../llvm-gcc.src/gcc/../include -I./../intl -I../../llvm-gcc.src/gcc/../libcpp/include  -I../../llvm-gcc.src/gcc/../libdecnumber -I../libdecnumber -I/Volumes/Gir/devel/llvm/clean/llvm.obj/include -I/Volumes/Gir/devel/llvm/clean/llvm.src/include -fexceptions -fvisibility=hidden -DHIDE_EXPORTS -c ../../llvm-gcc.src/gcc/unwind-dw2-fde-darwin.c -o libgcc/./unwind-dw2-fde-darwin.o
Assertion failed: (TargetRegisterInfo::isVirtualRegister(regA) && TargetRegisterInfo::isVirtualRegister(regB) && "cannot update physical register live information"), function runOnMachineFunction, file /Volumes/Gir/devel/llvm/clean/llvm.src/lib/CodeGen/TwoAddressInstructionPass.cpp, line 311.
../../llvm-gcc.src/gcc/unwind-dw2.c:1527: internal compiler error: Abort trap
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://developer.apple.com/bugreporter> for instructions.
{standard input}:3521:non-relocatable subtraction expression, "_dwarf_reg_size_table" minus "L20$pb"
{standard input}:3521:symbol: "_dwarf_reg_size_table" can't be undefined in a subtraction expression
{standard input}:3520:non-relocatable subtraction expression, "_dwarf_reg_size_table" minus "L20$pb"
...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56703 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26 22:10:44 +00:00
Dan Gohman
533d3b3f37 Fix missing whitespace in the printing of function notes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56702 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26 22:02:59 +00:00
Dan Gohman
7810bfed55 Rename ConstantSDNode's getSignExtended to getSExtValue, for
consistancy with ConstantInt, and re-implement it in terms
of ConstantInt's getSExtValue.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56700 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26 21:54:37 +00:00
Dan Gohman
f275250333 Make some minor reorganizations and comment changes to eliminate trivial
differences between the CallInst and InvokeInst classes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56699 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26 21:38:45 +00:00
Dan Gohman
83ccd14228 Mark lea fi# as being really rematerializable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56698 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26 21:30:20 +00:00
Evan Cheng
c739489c19 unpckhps requires sse1, punpckhdq requires sse2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56697 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26 21:26:30 +00:00
Daniel Dunbar
0526778ab7 Update LICENSE link.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56689 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26 21:12:29 +00:00
Dan Gohman
09aae469ce Fix X86FastISel's address folding to check displacement
values for overflow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56686 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26 20:04:15 +00:00
Evan Cheng
36a55023c1 Fix @llvm.frameaddress codegen. FP elimination optimization should be disabled when frame address is desired. Also add support for depth > 0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56683 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26 19:48:35 +00:00
Oscar Fuentes
dbc2e856fc CMake: Builds all examples. Corrected name of CBackend target.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56682 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26 19:48:03 +00:00
Dale Johannesen
dfe8c84e1e Generated files for previous patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56679 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26 19:32:34 +00:00
Dale Johannesen
7fefc6b4fe Another file I forgot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56678 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26 19:31:53 +00:00
Dale Johannesen
86098bd6a6 Add "inreg" field to CallSDNode (doesn't increase
its size).  Adjust various lowering functions to
pass this info through from CallInst.  Use it to
implement sseregparm returns on X86.  Remove
X86_ssecall calling convention.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56677 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26 19:31:26 +00:00
Dan Gohman
97135e1ee5 Factor out the code for determining when symblic addresses
require RIP-relative addressing and use it to fix a bug
in X86FastISel in x86-64 PIC mode, where it was trying to
use base/index registers with RIP-relative addresses. This
fixes a bunch of x86-64 testsuite failures.


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