Commit Graph

11297 Commits

Author SHA1 Message Date
Bob Wilson
8561dcd730 Move the EnableFullLoadPRE flag from a separate command-line option to an
argument of createGVNPass and set it automatically for -O3.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97245 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 19:09:47 +00:00
Bob Wilson
60df9077eb Remove unused "NoPRE" parameter in GVN and createGVNPass().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97235 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 18:35:19 +00:00
Chris Lattner
00947ee2db fix the matcher in the presence of multiple scopes: we need to save
and restore the entire matcher stack by value.  This is because children
we're testing could do moveparent or other things besides just 
scribbling on additions to the stack.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97212 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 07:28:20 +00:00
Chris Lattner
d6c84720df change the scope node to include a list of children to be checked
instead of to have a chained series of scope nodes.  This makes
the generated table smaller, improves the efficiency of the
interpreter, and make the factoring optimization much more 
reasonable to implement.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97160 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 19:00:39 +00:00
Chris Lattner
bb82b146e9 remove a dead PatLeaf, I previously changed all uses to use -1 instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97148 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 17:39:34 +00:00
Dan Gohman
a5a23046cb Add more information to the getSizeOf comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97140 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 15:55:28 +00:00
Dan Gohman
aa9d854b33 Revert r97064. Duncan pointed out that bitcasts are defined in
terms of store and load, which means bitcasting between scalar
integer and vector has endian-specific results, which undermines
this whole approach.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97137 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 15:20:39 +00:00
Chris Lattner
60df53e30a rename PushMatcherNode -> ScopeMatcherNode to more accurately
reflect what it does.  Switch the sense of the Next and the Check
arms to be more logical.  No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97093 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 01:56:48 +00:00
Chris Lattner
556a1b47e2 fix a bug I introduced by checking the wrong node's VT in OPC_CheckChildXType
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97074 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 22:52:52 +00:00
Dan Gohman
c382bc3c0f Make getTypeSizeInBits work correctly for array types; it should return
the number of value bits, not the number of bits of allocation for in-memory
storage.

Make getTypeStoreSize and getTypeAllocSize work consistently for arrays and
vectors.

Fix several places in CodeGen which compute offsets into in-memory vectors
to use TargetData information.

This fixes PR1784.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97064 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 22:05:23 +00:00
Chris Lattner
23cfda719e contract movechild+checktype into a new checkchild node, shrinking the
x86 table by 1200 bytes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97053 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 20:15:25 +00:00
Dan Gohman
f6d009fb6f Convert a few more backedge-taken count functions to use BackedgeTakenInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97042 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 17:31:30 +00:00
Daniel Dunbar
6d8f2ca646 Reapply r97010, the speculative revert failed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97036 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 08:48:04 +00:00
Chris Lattner
19b5a7590b implement a simple proof-of-concept optimization for
the new isel: fold movechild+record+moveparent into a
single recordchild N node.  This shrinks the X86 table
from 125443 to 117502 bytes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97031 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 07:31:45 +00:00
Daniel Dunbar
8c0c99016b Speculatively revert r97010, "Add an argument to PHITranslateValue to specify
the DominatorTree. ...", in hopes of restoring poor old PPC bootstrap.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97027 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 06:55:22 +00:00
Dan Gohman
e832693acb When forming SSE min and max nodes for UGE and ULE comparisons, it's
necessary to swap the operands to handle NaN and negative zero properly.

Also, reintroduce logic for checking for NaN conditions when forming
SSE min and max instructions, fixed to take into consideration NaNs and
negative zeros. This allows forming min and max instructions in more
cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97025 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 06:52:40 +00:00
Chris Lattner
02f73585f7 The new isel was not properly handling patterns that covered
internal nodes with flag results.  Record these with a new 
OPC_MarkFlagResults opcode and use this to update the interior
nodes' flag results properly.  This fixes CodeGen/X86/i256-add.ll
with the new isel.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97021 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 05:33:42 +00:00
Bob Wilson
9d2ed8e632 Add an argument to PHITranslateValue to specify the DominatorTree. If this
argument is non-null, pass it along to PHITranslateSubExpr so that it can
prefer using existing values that dominate the PredBB, instead of just
blindly picking the first equivalent value that it finds on a uselist.
Also when the DominatorTree is specified, have PHITranslateValue filter
out any result that does not dominate the PredBB.  This is basically just
refactoring the check that used to be in GetAvailablePHITranslatedSubExpr
and also in GVN.

Despite my initial expectations, this change does not affect the results
of GVN for any testcases that I could find, but it should help compile time.
Before this change, if PHITranslateSubExpr picked a value that does not
dominate, PHITranslateWithInsertion would then insert a new value, which GVN
would later determine to be redundant and would replace.  By picking a good
value to begin with, we save GVN the extra work of inserting and then
replacing a new value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97010 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 01:39:00 +00:00
Chris Lattner
cec479de4e fix X86/uint_to_fp-2.ll, only fold loads when they have a
single use.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97003 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 23:47:34 +00:00
Jakob Stoklund Olesen
dcfe5f30b5 Keep track of phi join registers explicitly in LiveVariables.
Previously, LiveIntervalAnalysis would infer phi joins by looking for multiply
defined registers. That doesn't work if the phi join is implicitly defined in
all but one of the predecessors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96994 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 22:43:58 +00:00
Wesley Peck
a70f28ce7d Adding the MicroBlaze backend.
The MicroBlaze is a highly configurable 32-bit soft-microprocessor for
use on Xilinx FPGAs. For more information see:
http://www.xilinx.com/tools/microblaze.htm
http://en.wikipedia.org/wiki/MicroBlaze

The current LLVM MicroBlaze backend generates assembly which can be
compiled using the an appropriate binutils assembler.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96969 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 19:15:24 +00:00
Kevin Enderby
6e72048add This is the first patch to put the needed bits in place to eventually allow code
to be aligned with optimal nops.  This patch does not change any functionality
and when the compiler is changed to use EmitCodeAlignment() it should also not
change the resulting output.  Once the compiler change is made and everything
looks good the next patch with the table of optimal X86 nops will be added to
WriteNopData() changing the output.  There are many FIXMEs in this patch which
will be removed when we have better target hooks (coming soon I hear).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96963 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 18:26:34 +00:00
Mikhail Glushenkov
a34f97ab22 Correct option forwarding: initial implementation.
Does not work, but the infrastructure changes are in place.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96920 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 09:04:44 +00:00
Mikhail Glushenkov
be6ee7c116 New experimental/undocumented feature: 'works_on_empty'.
For now, just enough support to make -filelist work.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96918 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 09:04:28 +00:00
Mikhail Glushenkov
a04d4ed690 Add a way to enable '-opt=foo' forwarding.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96916 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 09:04:13 +00:00
Chris Lattner
5ce9d0b606 fix an off-by-one error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96844 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 01:07:09 +00:00
Chris Lattner
5007e1e435 switch the value# in OPC_CompleteMatch and OPC_EmitNode to use a
VBR encoding for the insanity being perpetrated by the spu backend. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96843 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 00:59:59 +00:00
Chris Lattner
3e22f2d489 add a new Push2 opcode for targets (like cellspu) which have
ridiculously ginormous patterns and need more than one byte
of displacement for encodings.  This fixes CellSPU/fdiv.ll.
SPU is still doing something else ridiculous though.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96833 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-22 23:55:39 +00:00
Jim Grosbach
4642ad3af1 Updated version of r96634 (which was reverted due to failing 176.gcc and
126.gcc nightly tests. These failures uncovered latent bugs that machine DCE
could remove one half of a stack adjust down/up pair, causing PEI to assert.
This update fixes that, and the tests now pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96822 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-22 23:10:38 +00:00
Chris Lattner
418b568336 expand my hack to work with nodes that have flags but no chains and the
isel doesn't know the correct # results.  This fixes 8 codegen tests,
down to 22 failures.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96815 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-22 22:37:11 +00:00
Chris Lattner
12a667c1e8 add a new CheckMultiOpcode opcode for checking that a node
has one of the list of acceptable opcodes for a complex 
pattern.  This fixes 4 regtest failures.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96814 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-22 22:30:37 +00:00
Chris Lattner
3df577b71b add some debug hooks for tracking the behavior of the isel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96812 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-22 22:15:39 +00:00
Dan Gohman
fb76fe0929 Fix various doxygen warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96779 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-22 04:10:52 +00:00
Dan Gohman
31a95c524c Rename a variable to avoid a -Wshadow warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96776 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-22 04:04:24 +00:00
Chris Lattner
74fd536158 enhance my hack for flags handling, this allows us to pass
CodeGen/X86/pr2182.ll.  Down to 13 x86 failures out of ~1100


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96770 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-22 00:47:38 +00:00
Chris Lattner
565a6f9480 fix most of the failures in the x86 suite by handling multiple
result nodes correctly.  Note that this includes a horrible hack
in DAGISelHeader which cannot be fixed reasonably without 
eliminating (parallel) from input patterns.  That, in turn,
can't be done until we support writing multiple result patterns
for the X86and_flag and related multiple-result nodes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96767 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-21 23:54:05 +00:00
Daniel Dunbar
e7bd886cb8 MC: Sketch registry support for target specific assembler backends.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96762 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-21 21:53:53 +00:00
Daniel Dunbar
24b5425072 Formatting tweaks (trailing whitespace, ordering, comments).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96761 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-21 21:53:37 +00:00
Chris Lattner
502035e541 fix an odd thinko in an assertion, all arm tests pass now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96758 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-21 20:57:28 +00:00
Anton Korobeynikov
293d592bf9 It turned out that we failed to emit proper symbol stubs on non-x86/darwin for ages (we emitted a reference to a stub, but no stub was emitted). The code inside x86-32/macho target objfile lowering should actually be the generic one - move it there.
This (I really, really hope) should fix EH issues on ppc/darwin
and arm/darwin.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96755 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-21 20:28:15 +00:00
Chris Lattner
be94ffcf12 speculatively teach OPC_CheckValueType and OPC_EmitNode to handle
MVT::iPTR.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96753 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-21 20:15:25 +00:00
Chris Lattner
be92e6a0d2 teach OPC_CheckType to handle MVT::iPTR, down to 2 ppc failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96752 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-21 20:10:43 +00:00
Chris Lattner
1d4cb41fdd make this check a bit more generous, it may be outliving its
utility.  Down to 6 ppc failures.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96751 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-21 20:02:15 +00:00
Chris Lattner
1e4b8bc93b Relax an assertion a bit. We allow replacing things like
<4 x i32> with <4 x float> values if they end up the same
register class.  This gets us up to 231 passes on the ppc
tests (only 7 fails).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96750 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-21 19:35:07 +00:00
Chris Lattner
863cc971e8 when a match fails and we have to rollback, make sure to keep 'N' in
sync with the top of stack.  This fixes a bunch of failures on larger
testcases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96732 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-21 07:55:48 +00:00
Chris Lattner
0fb65cffa6 handle optional in flags that aren't present.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96731 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-21 07:19:06 +00:00
Chris Lattner
a7399e4abf fix two bugs in OPC_EmitRegister, which makes ppc happier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96728 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-21 06:58:27 +00:00
Chris Lattner
77f2e2724d implement the last known missing feature: updating uses of results
of the matched pattern to use the newly created node results.  Onto
the "making it actually work" phase!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96724 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-21 06:03:07 +00:00
Charles Davis
89e124b6be Reduce size of 'StackAlignment' field from 5 to 3 bits. Seriously, who needs a
2GB-aligned stack anyway? 256 bytes is plenty. Requested by Chris.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96718 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-21 04:26:06 +00:00
Chris Lattner
8e946bea14 Lots of improvements to the new dagisel emitter. This gets it to
the point where it is to the 95% feature complete mark, it just
needs result updating to be done (then testing, optimization 
etc).

More specificallly, this adds support for chain and flag handling
on the result nodes, support for sdnodexforms, support for variadic
nodes, memrefs, pinned physreg inputs, and probably lots of other
stuff.

In the old DAGISelEmitter, this deletes the dead code related to
OperatorMap, cleans up a variety of dead stuff handling "implicit
remapping" from things like globaladdr -> targetglobaladdr (which
is no longer used because globaladdr always needs to be legalized),
and some minor formatting fixes.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96716 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-21 03:22:59 +00:00