Commit Graph

33145 Commits

Author SHA1 Message Date
Anton Korobeynikov
90593d2e1f Implement branch folding
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84774 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 19:17:18 +00:00
Anton Korobeynikov
3926fb63c2 Cosmetic changes, no functionality changes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84773 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 19:16:49 +00:00
Victor Hernandez
68afa54033 Make changes to rev 84292 as requested by Chris Lattner.
Most changes are cleanup, but there is 1 correctness fix:
I fixed InstCombine so that the icmp is removed only if the malloc call is removed (which requires explicit removal because the Worklist won't DCE any calls since they can have side-effects).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84772 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 19:11:40 +00:00
Bob Wilson
b27b51aaa6 Fix NEON VST2LN instruction encoding.
Patch by Johnny Chen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84767 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 17:54:01 +00:00
Bob Wilson
407d57489f Revert 84732. It was the wrong fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84766 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 17:52:34 +00:00
Devang Patel
b5df28a151 Incorporate various suggestions Chris gave during metadata review.
- i < getNumElements()  instead of getNumElements() > i
- Make setParent() private
- Fix use of resizeOperands
- Reset HasMetadata bit after removing all metadata attached to an instruction
- Efficient use of iterators



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84765 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 17:33:41 +00:00
Sanjiv Gupta
36a9c8f0b3 Build shared lib instead of an archive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84764 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 17:27:23 +00:00
Jim Grosbach
3325537682 Cleanup of frame index scavenging. Better code flow and more accurately
handles T2 and ARM use cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84761 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 15:26:21 +00:00
Torok Edwin
0739bd0ab2 Fix PR5262: when folding select into PHI, make sure all operands are available
in the PHI's Basic Block. This uses a conservative approach, because we don't
have dominator info in instcombine.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84754 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 10:49:00 +00:00
Sanjiv Gupta
4e4bba5c80 Add a pass to overlay pic16 data sections for function frame and automatic
variables. This pass can be invoked by llvm-ld or opt to traverse over the call graph 
to detect what function frames and their automatic variables can be overlaid.
Currently this builds an archive , but needs to be changed to a loadable module.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84753 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 10:42:44 +00:00
Evan Cheng
2095659a85 Match more patterns to movt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84751 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 08:15:52 +00:00
Evan Cheng
5affca0763 Need a comma after imp-use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84749 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 07:56:02 +00:00
Douglas Gregor
7bb3862895 De-bork CMake build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84744 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 06:01:54 +00:00
Chris Lattner
a52fce49eb make GVN work better when TD is not around:
"In the existing code, if the load and the value to replace it with are
of different types *and* target data is available, it tries to use the
target data to coerce the replacement value to the type of the load.
Otherwise, it skips all effort to handle the type mismatch and just
feeds the wrongly-typed replacement value to replaceAllUsesWith, which
triggers an assertion.

The patch replaces it with an outer if checking for type mismatch, and
an inner if-else that checks whether target data is available and, if
not, returns false rather than trying to replace the load."

Patch by Kenneth Uildriks!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84739 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 04:11:19 +00:00
Chris Lattner
1ce75ef5ef tidy
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84738 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 04:10:24 +00:00
Bob Wilson
b3c8359360 Fix some more NEON instruction encoding problems.
Thanks to Johnny Chen for discovering the problem.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84732 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 02:27:20 +00:00
Devang Patel
08e4339310 Do not remove dead metadata for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84731 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 02:21:34 +00:00
Bob Wilson
507df402b0 Leave some NEON instruction encoding bits unspecified instead of setting
a default value of zero.  This is important for decoding the instructions.
Patch by Johnny Chen, with some changes from me, too.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84730 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 02:15:46 +00:00
Dan Gohman
c1ae8c9b8f Revert r84658 and r84691. They were causing llvm-gcc bootstrap to fail.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84727 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 01:44:44 +00:00
Chris Lattner
7d26443bb7 IPSCCP is missing stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84725 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 01:10:37 +00:00
Jeffrey Yasskin
4cdc5bb707 Delete the MacOSJITEventListener per echristo's request. It was disabled by
default and didn't work anyway.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84720 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 00:43:48 +00:00
Anton Korobeynikov
12ddf139ce Add note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84713 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 00:14:15 +00:00
Anton Korobeynikov
514200d5ef Be crazy and assert in case of unsupported modifier passed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84712 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 00:13:58 +00:00
Anton Korobeynikov
0a2e206b40 Handle external symbols
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84711 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 00:13:42 +00:00
Anton Korobeynikov
8ecaf237e0 Distinguish between pcrel imm operands and 'normal' ones. Fix fixes gross weirdness of asmprinting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84710 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 00:13:25 +00:00
Anton Korobeynikov
dc2165e18e Add basic block operands & jump kinds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84709 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 00:13:05 +00:00
Anton Korobeynikov
3d6e560eef Ignore all implicit reg operands
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84708 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 00:12:44 +00:00
Anton Korobeynikov
efa236f40d Add a workaround for different memops prefixes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84707 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 00:12:27 +00:00
Anton Korobeynikov
9b0b852698 Checkpoint MCInst printer. We (almostly) able to print global / JT / constpool entries
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84706 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 00:12:08 +00:00
Anton Korobeynikov
b5a921679f Add simple operand printing stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84704 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 00:11:27 +00:00
Anton Korobeynikov
13853e233b Add experimental MSP430 MCInstLowering stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84703 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 00:11:08 +00:00
Anton Korobeynikov
1074aae0d1 Wire up MSP430 printMCInst() method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84702 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 00:10:47 +00:00
Anton Korobeynikov
680dec703c Add MSP430 InstPrinter stub
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84701 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 00:10:30 +00:00
Anton Korobeynikov
51f3f9a8a7 Use proper target data
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84700 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 00:10:00 +00:00
David Goodwin
7441d14873 Respect src register allocation requirements when breaking anti-dependencies. Remove some dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84691 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 22:50:43 +00:00
Devang Patel
d9723e9a28 Cosmetic changes.
s/validName/isValidName/g
s/with an Instruction/to an Instruction/g
s/RegisterMDKind/registerMDKind/g


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84689 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 22:50:27 +00:00
Daniel Dunbar
a7cc65283a Fix -Asserts warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84687 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 22:10:05 +00:00
Anton Korobeynikov
2bcf60a9cc Fix invalid for vector types fneg(bitconvert(x)) => bitconvert(x ^ sign)
transform.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84683 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 21:37:45 +00:00
Lang Hames
3fd7a68ba9 Oops. Backing out 84681 - needs to wait for the indexing patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84682 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 21:28:22 +00:00
Lang Hames
67f25669db Added some debugging output to pre-alloc splitting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84681 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 21:25:13 +00:00
Dan Gohman
eed9e5b833 Fix another place that calls Loop::contains a lot to construct a sorted
container of the blocks and do efficient lookups. This makes
isLoopSimplifyForm much faster on large loops, fixing a significant
compile-time issue in builds with assertions enabled.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84673 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 20:41:13 +00:00
Jim Grosbach
3229b0bcf1 Disable by default while debugging
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84669 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 20:31:31 +00:00
Chris Lattner
88a8624f8e alternate fix for PR5258 which avoids worklist problems, with reduced testcase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84667 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 20:27:49 +00:00
Jim Grosbach
18ed9c9a2b add cmd line opt to disable frame index reuse for ARM and T2. debug aid.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84664 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 20:19:50 +00:00
Dan Gohman
cd53f64367 Restore LoopUnswitch's block-oriented threshold. LoopUnswitch now checks both
the estimated code size and the number of blocks when deciding whether to
do a non-trivial unswitch. This protects it from some very undesirable
worst-case behavior on large numbers of loop-unswitchable conditions, such
as in the testcase in PR5259.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84661 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 20:06:09 +00:00
David Goodwin
480c529e02 Checkpoint more aggressive anti-dependency breaking for post-ra scheduler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84658 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 19:54:44 +00:00
Jim Grosbach
03d02d4faa Better handle instructions that re-def a scratch register
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84657 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 19:52:35 +00:00
Dan Gohman
bab42bdd87 Following r84485, add Defs = [EFLAGS] to the 32-bit lock instructions too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84652 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 18:14:49 +00:00
Jeffrey Yasskin
1e86132122 Move the Function*->allocated blocks map from the JITMemoryManager to the
JITEmitter.

I'm gradually making Functions auto-remove themselves from the JIT when they're
destroyed. In this case, the Function needs to be removed from the JITEmitter,
but the map recording which Functions need to be removed lived behind the
JITMemoryManager interface, which made things difficult.

This patch replaces the deallocateMemForFunction(Function*) method with a pair
of methods deallocateFunctionBody(void *) and deallocateExceptionTable(void *)
corresponding to the two startFoo/endFoo pairs.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84651 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 18:13:21 +00:00
Jim Grosbach
f7a0c0de6d Register re-use for scavenged frame indices must check for re-deginition
of the register in the instruction which kills the scavenged value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84641 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 16:33:57 +00:00
Dan Gohman
1a49295eae Make TranslateX86CC return COND_INVALID instead of aborting when it
encounters an OEQ or UNE comparison, and update its callers to check
for this return status and recover. This fixes a problem resulting from
the LowerOperation hooks being called from LegalizeVectorOps, because
LegalizeVectorOps only lowers vectors, so OEQ and UNE comparisons may
still be at large. This fixes PR5092.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84640 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 16:22:37 +00:00
Torok Edwin
f993327e71 Fix PR5258, jump-threading creating invalid PHIs.
When an incoming value for a PHI is updated, we must also updated all other
incoming values for the same BB to match, otherwise we create invalid PHIs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84638 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 15:42:00 +00:00
Torok Edwin
2b6183d254 Fix PR4313: IPSCCP was not setting the lattice value for the invoke instruction
when the invoke had multiple return values: it set the lattice value only on the
extractvalue.
This caused the invoke's lattice value to remain the default (undefined), and
later propagated to extractvalue's operand, which incorrectly introduces
undefined behavior.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84637 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 15:15:09 +00:00
Benjamin Kramer
174101e13a Random #include pruning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84632 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 11:44:38 +00:00
Sanjiv Gupta
2edef7efdc This file is replaeced by PIC16Section.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84628 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 09:16:32 +00:00
Chris Lattner
235e2f6a68 implement some more easy hooks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84614 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 06:22:33 +00:00
Chris Lattner
bf16faa16a Implement some hooks, make printOperand abort if unknown modifiers are
present.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84613 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 06:15:28 +00:00
Chris Lattner
c6b8a99207 t2MOVi32imm is currently always lowered by the Thumb2ITBlockPass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84611 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 05:58:02 +00:00
Daniel Dunbar
2685a29a8d Wire up the ARM MCInst printer, for llvm-mc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84600 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 05:15:36 +00:00
Dan Gohman
07adb85cb7 Re-apply r84295, with fixes to how the loop "top" and "bottom" blocks are
tracked. Instead of trying to manually keep track of these locations
while doing complex modifications, just recompute them when they're needed.
This fixes a bug in which the TopMBB and BotMBB were not correctly updated,
leading to invalid transformations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84598 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 04:50:37 +00:00
Evan Cheng
5f4fb86d58 Trim unnecessary includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84597 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 04:23:20 +00:00
Dan Gohman
81b16a3558 Add getTopBlock and getBottomBlock member functions to MachineLoopInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84596 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 04:16:37 +00:00
Jim Grosbach
8fa4efeabf Now that all ARM subtargets use frame index scavenging, the Thumb1 requires*
functions are not needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84587 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 01:32:47 +00:00
Evan Cheng
0222a8cfb8 If the physical register being spilled does not have an interval, spill its sub-registers instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84586 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 01:31:09 +00:00
Jim Grosbach
7e831db1d4 Enable post-pass frame index register scavenging for ARM and Thumb2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84585 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 01:26:58 +00:00
Chris Lattner
161dcbf799 lower ARM::MOVi32imm properly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84583 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 01:11:37 +00:00
Chris Lattner
292df8eb1f add support for external symbols. The mc instprinter can now handle
reasonable code like Codegen/ARM/2009-02-27-SpillerBug.ll, producing 
identical output except for superior formatting of constant pool entries.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84582 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 00:56:16 +00:00
Chris Lattner
96bc2173bb get fancy: support basic block operands. Yay for jumps.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84579 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 00:52:47 +00:00
Chris Lattner
233917c072 add supprort for the 'sbit' operand, MOVi apparently has one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84577 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 00:46:11 +00:00
Chris Lattner
413ae25fb5 add support for instruction predicates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84575 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 00:42:49 +00:00
Chris Lattner
017d9478d5 implement printSORegOperand, add lowering for the nasty and despicable MOVi2pieces :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84573 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 00:40:56 +00:00
Jim Grosbach
1fc1dc0682 Refs: A8-598.
Leave Inst{11-8}, which represents the starting byte index of the extracted
result in the concatenation of the operands and is left unspecified.

Patch by Johnny Chen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84572 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 00:38:19 +00:00
Jim Grosbach
780d207d1c Add missing encoding bits to NLdSt class of instructions.
Patch by Johnny Chen.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84570 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 00:19:08 +00:00
Chris Lattner
af0df67d2b X86 should ignore implicit regs when lowering to MCInst also,
no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84567 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 23:35:57 +00:00
Chris Lattner
306d14f9aa handle addmode4 modifiers, fix a fixme in printRegisterList
by ignoring all implicit regs when lowering.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84566 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 23:31:43 +00:00
Chris Lattner
84d8bf9d28 simplify by using the twine form of GetOrCreateSymbol
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84565 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 23:05:23 +00:00
Jim Grosbach
6009751244 Enable allocation of R3 in Thumb1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84563 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 22:57:03 +00:00
Chris Lattner
5a207897bc use EmitLabel instead of text emission
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84562 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 22:51:16 +00:00
Chris Lattner
7c5b021793 add a twine version of MCContext::GetOrCreateSymbol.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84561 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 22:49:00 +00:00
Chris Lattner
a70e644820 lower the ARM::CONSTPOOL_ENTRY pseudo op, giving us constant pool entries
like:

@ BB#1:
	.align	2
LCPI1_0:
	.long	L_.str-(LPC0+8)

Note that proper indentation of the label :)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84558 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 22:33:05 +00:00
Jim Grosbach
d482f55af1 Adjust the scavenge register spilling to allow the target to choose an
appropriate restore location for the spill as well as perform the actual
save and restore.

The Thumb1 target uses this to make sure R12 is not clobbered while a spilled
scavenger register is live there.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84554 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 22:27:30 +00:00
Chris Lattner
4d15222341 add MCInstLower support for lowering ARM::PICADD, a pseudo op for pic stuffola.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84553 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 22:23:04 +00:00
Owen Anderson
d41ed4e2c4 Refactor lookup_or_add to contain _MUCH_ less duplicated code. Add support for
numbering first class aggregate instructions while we're at it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84547 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 22:14:22 +00:00
Chris Lattner
e306d8d6cc add register list and hacked up addrmode #4 support, we now get this:
_main:
	stmsp! sp!, {r7, lr}
	mov r7, sp
	sub sp, sp, #4
	mov r0, #0
	str r0, [sp]
	ldr r0, LCPI1_0
	bl _printf
	ldr r0, [sp]
	mov sp, r7
	ldmsp! sp!, {r7, pc}

Note the unhappy ldm/stm because of modifiers being ignored.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84546 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 22:09:23 +00:00
Chris Lattner
3310a963cf revert r84540, fixing build breakage I didn't see because of
broken makefile deps :(


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84544 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 21:59:25 +00:00
Chris Lattner
084f87d445 add addrmode2 support, getting us up to:
_main:
	stm , 
	mov r7, sp
	sub sp, sp, #4
	mov r0, #0
	str r0, [sp]
	ldr r0, LCPI1_0
	bl _printf
	ldr r0, [sp]
	mov sp, r7
	ldm , 



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84543 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 21:57:05 +00:00
Chris Lattner
6f99776f6c add jump tables, constant pools and some trivial global
lowering stuff.  We can now compile hello world to:

_main:
	stm , 
	mov r7, sp
	sub sp, sp, #4
	mov r0, #0
	str r0, 
	ldr r0, 
	bl _printf
	ldr r0, 
	mov sp, r7
	ldm , 

Almost looks like arm code :)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84542 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 21:53:00 +00:00
Victor Hernandez
93bb60d379 Malloc calls are marked NoAlias, so the code below the isMalloc() check makes it redundant. Removing the isMalloc() check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84541 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 21:47:22 +00:00
Chris Lattner
83e43ca1b6 pass mangler in as a reference instead of a pointer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84540 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 21:45:31 +00:00
Chris Lattner
8514e21deb reduce #includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84536 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 21:23:15 +00:00
Chris Lattner
61d35c273e add printing support for SOImm operands, getting us to:
_main:
	stm , 
	mov r7, sp
	sub sp, sp, #4
	mov r0, #0
	str r0, 



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84535 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 21:21:39 +00:00
Owen Anderson
158d86e5b0 Simplify some code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84533 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 21:14:57 +00:00
Chris Lattner
8bc86cba60 wire up some basic printOperand goodness, giving us stuff like this before
we abort:

_main:
	stm , 
	mov r7, sp
	sub sp, sp, 
	mov r0, 
	str r0, 



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84532 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 20:59:55 +00:00
Chris Lattner
9cf0eb5e58 add the files that go with the previous rev
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84531 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 20:21:05 +00:00
Chris Lattner
97f0693744 wire up skeletal support for having llc print instructions
through mcinst lowering -> mcinstprinter, when llc is passed
the -enable-arm-mcinst-printer flag.  Currently this
is very "aborty".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84530 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 20:20:46 +00:00
Owen Anderson
59d5aac0b4 Banish ConstantsLock. It's serving no purpose other than slowing things down
at the moment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84529 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 20:11:52 +00:00
Chris Lattner
6a71afaec1 wire up ARM's printMCInst method. Now llvm-mc should be able to produce
"something" when printing MCInsts, it will just be missing all the 
operand info.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84528 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 19:59:05 +00:00
Chris Lattner
fd60382e75 stub out a minimal ARMInstPrinter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84527 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 19:56:26 +00:00
Chris Lattner
172862a2a7 remove strings from instructions who are never asmprinted.
All of these "subreg32" modifier instructions are handled
explicitly by the MCInst lowering phase.  If they got to
the asmprinter, they would explode.  They should eventually
be replace with correct use of subregs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84526 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 19:51:42 +00:00
Jeffrey Yasskin
ebbcef945d Clean up the JITResolver stub/callsite<->function maps.
The JITResolver maps Functions to their canonical stubs and all callsites for
lazily-compiled functions to their target Functions. To make Function
destruction work, I'm going to need to remove all callsites on destruction, so
this patch also adds the reverse mapping for that.

There was an incorrect assumption in here that the only stub for a function
would be the one caused by needing to lazily compile it, while x86-64 far calls
and dlsym-stubs could also cause such stubs, but I didn't look for a test case
that the assumption broke.

This also adds DenseMapInfo<AssertingVH> so I can use DenseMaps instead of
std::maps.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84522 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 18:49:59 +00:00