Commit Graph

38023 Commits

Author SHA1 Message Date
Dan Gohman
d858e90f03 Use const qualifiers with TargetLowering. This eliminates several
const_casts, and it reinforces the design of the Target classes being
immutable.

SelectionDAGISel::IsLegalToFold is now a static member function, because
PIC16 uses it in an unconventional way. There is more room for API
cleanup here.

And PIC16's AsmPrinter no longer uses TargetLowering.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101635 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 15:26:15 +00:00
Dan Gohman
1e93df6f0b Move per-function state out of TargetLowering subclasses and into
MachineFunctionInfo subclasses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101634 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 14:41:14 +00:00
Chandler Carruth
2329d66a9f Name these stub files consistently with the SPU and PPC targets' conventions.
Also rename the classes appropriately. The CMake build already used these
names.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101631 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 08:50:29 +00:00
Chris Lattner
65de1b9eb3 a bunch of ssse3 instructions are misencoded to think they have an
i8 field when they really do not.  This fixes rdar://7840289


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101629 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 07:38:24 +00:00
Chris Lattner
ca5e4f8e19 reenable r101565, removing a problematic assertion.
CGSCC can delete nodes in regions of the callgraph that
have already been visited.  If new CG nodes are allocated
to the same pointer, we shouldn't abort, just handle it
correctly by assigning a new number.  This should restore
stability by removing invalidated pointers that *will* be
reused from the densemap in the iterator.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101628 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 07:17:19 +00:00
Evan Cheng
94d1d9c219 Postra machine licm must add registers defined by loop invariants to *all* of
the live-in sets of BBs in the loop. Otherwise later pass may end up using the
registers and override the invariant. rdar://7852937
No reasonablly sized test case possible.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101626 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 07:07:11 +00:00
Evan Cheng
f2b910922d Fix codegen passes. -disable-ssc shouldn't disable postra machine licm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101622 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 06:47:47 +00:00
Evan Cheng
e5b51ac770 More work to allow dag combiner to promote 16-bit ops to 32-bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101621 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 06:13:15 +00:00
Evan Cheng
4ff28527bb Another 80 col violation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101620 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 06:12:32 +00:00
Bob Wilson
9f3f061d74 Revise my previous change to ExpandBIT_CONVERT. I hadn't realized that this
may be called when either the source or destination type is i64, and my
change also hadn't fixed the most obvious problem -- assuming that i64 will
only be bitconverted to f64, ignoring the various vector types.
Radar 7873160.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101615 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 05:30:19 +00:00
Bob Wilson
84bd6b0c31 Re-commit my previous SSAUpdater changes. The previous version naively tried
to determine where to place PHIs by iteratively comparing reaching definitions
at each block.  That was just plain wrong.  This version now computes the
dominator tree within the subset of the CFG where PHIs may need to be placed,
and then places the PHIs in the iterated dominance frontier of each definition.
The rest of the patch is mostly the same, with a few more performance
improvements added in.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101612 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 03:08:24 +00:00
Bob Wilson
8295d4c96c As a temporary workaround for post-RA not handling DebugValue instructions,
just remove them all.  Radar 7873207 (working around the root problem of
Radar 7759363).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101604 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 00:49:11 +00:00
Jakob Stoklund Olesen
23eaf26fa3 Revert "Use a simpler data structure to calculate the least recently used register in RegAllocLocal."
This reverts commit 101392. It broke a buildbot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101595 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 00:38:36 +00:00
Chris Lattner
7e3e3252a1 disable r101565: an assert is getting triggered. More lurking badness no doubt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101583 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 00:05:36 +00:00
Chris Lattner
9484689f14 add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101581 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 23:52:30 +00:00
Eric Christopher
551754c495 Revert 101465, it broke internal OpenGL testing.
Probably the best way to know that all getOperand() calls have been handled
is to replace that API instead of updating.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101579 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 23:37:20 +00:00
Devang Patel
f2548caaa8 Add support to emit dwarf ranges.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101575 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 23:33:45 +00:00
Jakob Stoklund Olesen
cf7fbd41be Use a simpler data structure to calculate the least recently used register in RegAllocLocal.
This makes the local register allocator about 20% faster.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101574 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 23:32:37 +00:00
Johnny Chen
de0ade4939 Cast to (uint64_t) instead of relying on the "ul" suffix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101573 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 23:30:28 +00:00
Chris Lattner
bde0bb5f88 building on the new CallGraphSCC abstraction, teach CallGraphSCCPassManager
to keep the node entries in scc_iterator up to date instead of dangling as
the SCC mutates.

This is a really terrible problem which was causing -g to affect codegen 
because it would permute the memory image of the compiler process.

Thanks to Dale for expertly hunting it down.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101565 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 23:04:30 +00:00
Dan Gohman
53c5e42ab9 Add skeleton target-specific SelectionDAGInfo files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101564 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 23:04:22 +00:00
Johnny Chen
af5b0e851e Fixed logic error. Should check Builder for validity before calling SetSession
on it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101563 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 23:02:25 +00:00
Chris Lattner
a3dfc646b4 move ReplaceNode out of line, rename scc_iterator::fini -> isAtEnd().
No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101562 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 22:59:24 +00:00
Chris Lattner
2decb22222 introduce a new CallGraphSCC class, and pass it around
to CallGraphSCCPass's instead of passing around a
std::vector<CallGraphNode*>.  No functionality change,
but now we have a much tidier interface.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101558 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 22:42:17 +00:00
Johnny Chen
c7b65914e0 Fixed a bug in DisassembleN1RegModImmFrm() where a break stmt was missing for a
case.  Also, the 0xFF hex literal involved in the shift for ESize64 should be
suffixed "ul" to preserve the shift result.

Implemented printHex*ImmOperand() by copying from ARMAsmPrinter.cpp and added a
test case for DisassembleN1RegModImmFrm()/printHex64ImmOperand().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101557 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 22:40:20 +00:00
Evan Cheng
003d7c4b5d (i32 sext_in_reg (i32 aext (i16 x)), i16) -> (i32 sext x). No known test case until -promote-16bit is enabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101551 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 22:26:19 +00:00
Chris Lattner
c93760c3e5 move PrintCallGraphPass out of the middle of CGPassManager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101543 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 21:43:55 +00:00
Chris Lattner
aef1fea3d3 add a missing break back, patch by Nico Schmidt!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101538 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 21:15:15 +00:00
Dan Gohman
8c0e89925d Create a new TargetSelectionDAGInfo class. This will eventually acquire
SelectionDAG-specific parts of TargetLowering.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101537 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 21:12:11 +00:00
Dan Gohman
4bcf0a9233 Commit this, which should have accompanied 101531.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101532 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 20:22:43 +00:00
Dan Gohman
37f32ee7ff Eliminate an unnecessary SelectionDAG dependency in getOptimalMemOpType.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101531 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 20:11:05 +00:00
Johnny Chen
16fda6982b In the same spirit of r101524, which removed the assert() from printAddrMode2OffsetOperand(),
this patch removes the assert() from printAddrMode3OffsetOperand() and adds a test case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101529 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 19:57:21 +00:00
Johnny Chen
2fb10f17d8 Multiclass LdStCop was using pre-UAL syntax LDC<c>L for the L fragment. Changed
to the UAL syntax of LDCL<c>, instead.

Add a test case for this change which also tests the removal of assert() from
printAddrMode2OffsetOperand().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101527 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 19:33:23 +00:00
Johnny Chen
d73d187e33 Remove the assert() from printAddrMode2OffsetOperand(). "#0 and #-0" are
considered legal instructions.

Refs: A8.6.51 LDC, LDC2 (immediate) -- page A8-107, A8.6.58 LDR (immediate, ARM)
-- page A8-121, and A8.6.194 STR (immediate, ARM) -- page A8-395.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101524 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 19:10:52 +00:00
Evan Cheng
53f6ed9560 80 col.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101501 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 17:58:41 +00:00
Evan Cheng
182465c589 80 col.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101500 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 17:57:59 +00:00
Dan Gohman
33b7a291aa Avoid creating virtual registers for unused values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101480 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 17:15:02 +00:00
Dan Gohman
ac7d05c4bf Fix an assertion string.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101478 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 16:55:18 +00:00
Dan Gohman
a44e522b7d Fix a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101477 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 16:52:37 +00:00
Dan Gohman
b391bb8947 Disable inlining of recursive calls. It can complicate tailcallelim and
dependent analyses, and increase code size, so doing it profitably would
require more complex heuristics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101471 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 16:01:18 +00:00
Dan Gohman
ea25b48af3 Refine the detection of seemingly infinitely recursive calls where the
callee is expected to be expanded to something else by codegen, so that
normal infinitely recursive calls are still transformed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101468 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 15:57:50 +00:00
Gabor Greif
4ec2258ffb reapply r101434
with a fix for self-hosting

rotate CallInst operands, i.e. move callee to the back
of the operand array

the motivation for this patch are laid out in my mail to llvm-commits:
more efficient access to operands and callee, faster callgraph-construction,
smaller compiler binary


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101465 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 15:33:14 +00:00
Dan Gohman
52d55bd224 Make callIsSmall accessible as a utility function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101463 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 15:14:50 +00:00
Dan Gohman
a5145c8d5a Fix SCEVCommutativeExpr::print to be robust in the case of improper
expression canonicalization. Its job is to print what's there, not to
make judgements about it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101461 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 15:03:25 +00:00
Bill Wendling
47639fc5be The JIT calls TidyLandingPads to tidy up the landing pads. However, because the
JIT doesn't use the MC back-end asm printer to emit labels that it uses, the
section for the MCSymbol is never set. And thus the MCSymbol for the EH label
isn't marked as "defined". Because of that, TidyLandingPads removes the needed
landing pads from the JIT output. This breaks EH for every JIT program.

This is a work-around for this limitation. We pass in the label locations
map. If the label has a non-zero value, then it was "emitted" by the JIT and
TidyLandingPads shouldn't remove that label.

A nicer solution would be to mark the MCSymbol as "used" by the JIT and not rely
upon the section being set to determine if it's defined or not.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101453 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 08:46:10 +00:00
Evan Cheng
64b7bf71e8 Adding support for dag combiner to promote operations for profit. This requires target specific queries. For example, x86 should promote i16 to i32 when it does not impact load folding.
x86 support is off by default. It can be enabled with -promote-16bit.

Work in progress.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101448 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 06:14:10 +00:00
Evan Cheng
47b7b9f228 Use getAL() rather than a major constant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101446 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 05:46:06 +00:00
Dan Gohman
f89d1dc9b7 Refine further the scope where the global DebugLoc value is active.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101443 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 05:06:56 +00:00
Eric Christopher
107ae0ad8b Silence an unused variable warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101438 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 04:02:04 +00:00
Chris Lattner
a0bada729f fix comment noticed by Bob
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101437 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 02:32:17 +00:00