Commit Graph

30682 Commits

Author SHA1 Message Date
Dan Gohman
4f3cfba575 Make UnreachableMachineBlockElim preserve MachineDominatorTree and
MachineLoopInfo.

llc now runs MachineLoopInfo and MachineDominatorTree only twice, instead
of three times.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77759 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 00:34:30 +00:00
Dan Gohman
92aa4045d2 The X86 maximal stack alignment calculator preserves the CFG. Also,
be more careful about the return value of runOnMachineFunction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77758 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 00:31:02 +00:00
Dan Gohman
df09055cdb X86 floating-point passes don't modify the CFG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77757 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 00:26:16 +00:00
Evan Cheng
b620724e61 Fix Thumb2 function call isel. Thumb1 and Thumb2 should share the same
instructions for calls since BL and BLX are always 32-bit long and BX is always
16-bit long.

Also, we should be using BLX to call external function stubs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77756 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 00:16:10 +00:00
Dan Gohman
675fb65bf4 Use setPreservesAll in X86CodeEmitter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77755 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 23:44:16 +00:00
Dan Gohman
845012e6d3 Use setPreservesAll and setPreservesCFG in CodeGen passes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77754 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 23:37:33 +00:00
Dan Gohman
a3477fe06d SelectionDAGISel does not "preserve all", since it makes lots of changes
to the MachineFunction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77753 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 23:36:22 +00:00
Dan Gohman
2d147c4401 Use a range insert instead of an explicit loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77752 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 23:36:06 +00:00
Daniel Dunbar
ad4555c549 llvm-mc: Fix .s output to quote section & symbol names when necessary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77749 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 23:04:32 +00:00
Owen Anderson
7e3142b012 Privatize all but one of the remaining constant tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77748 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 22:45:43 +00:00
Bob Wilson
8d91955d2b Allow target intrinsics that return multiple values, i.e., struct types,
in SelectionDAGLowering::visitTargetIntrinsic.

This removes a bit of special-case code for vector types.  After staring
at it for a while, I managed to convince myself that it is not necessary.
The only case where TLI.getValueType() differs from MVT::getMVT is for iPTR,
so this code could potentially make a difference for a vector of pointers.
But, it looks like that is not supported.  Calling TLI.getValueType() on
a vector of pointers leads to the following sequence of calls:

TargetLowering::getValueType
MVT::getMVT
MVT::getVectorVT(iPTR, num elements)
MVT::getExtendedVectorVT
MVT::getTypeForMVT for iPTR
assertion fails "Type is not extended!"

So, unless I'm really missing something, this bit of code is irrelevant to
the current version of LLVM, which is consistent with the fact that I don't
see this code in other similar places.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77747 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 22:41:21 +00:00
Daniel Dunbar
c09e411102 llvm-mc: A few more parsing / match tweaks.
- Operands which are just a label should be parsed as immediates, not memory
   operands (from the assembler perspective).

 - Match a few more flavors of immediates.

 - Distinguish match functions for memory operands which don't take a segment
   register.

 - We match the .s for "hello world" now!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77745 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 22:22:54 +00:00
Evan Cheng
a0ee862f2e t2BR_JT is mov pc, it's 2 byte long, not 4.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77744 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 22:22:22 +00:00
Evan Cheng
1119776b19 Thumb2 movcc need .w suffix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77743 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 22:21:55 +00:00
Chris Lattner
46b754c76b add some comments on how this is *supposed* to work. We don't
need the PreferredEHDataFormat hook, but I have yet-more refactoring to
do before I can zap it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77742 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 22:18:14 +00:00
Chris Lattner
81c9a06937 rearrange a conditional. Even if this weren't #if 0'd out, this would
have no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77741 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 22:03:47 +00:00
David Greene
bef8768bd0 Simplify operand padding by keying off tabs in the asm stream. If
padding is disabled, tabs get replaced by spaces except in the case of
the first operand, where the tab is output to line up the operands after
the mnemonics.

Add some better comments and eliminate redundant code.

Fix some testcases to not assume tabs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77740 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 21:57:10 +00:00
Chris Lattner
7a01e95915 PreferredEHDataFormat is always call with data and global, but this whole
thing is #if0'd out anyway.  Just simplify the code by reducing the interface.
Not deleting this is essential for Bill's continuing happiness.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77736 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 21:39:55 +00:00
Owen Anderson
647e3016de Move the metadata constructors back to 2.5 syntax.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77733 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 21:35:40 +00:00
Dan Gohman
b41fc9f05c LibCallAliasAnalysis doesn't use TargetData.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77729 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 20:56:29 +00:00
Daniel Dunbar
022e2a84a8 llvm-mc/X86: Sketch match functions for immediates and memory operands.
Also, change scale value to always be 1 when unspecified to machine MachineInst
encoding.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77728 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 20:53:16 +00:00
Dan Gohman
f581213bfb Make TargetData optional in MemoryDependenceAnalysis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77727 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 20:53:12 +00:00
Chris Lattner
26630c1180 move emitUsedDirectiveFor to TargetLoweringObjectFile and rename it to
indicate that it is a predicate, not an emitter.  This eliminates TAI
dependencies on Mangler and GlobalValue.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77726 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 20:52:39 +00:00
Dan Gohman
cc726599ae Remove an unnecessary header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77725 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 20:47:45 +00:00
Chris Lattner
1db511cc91 remove the PPCLinuxTargetAsmInfo implementation of PreferredEHDataFormat,
because it just calls the default impl.

Remove the PPCDarwinTargetAsmInfo version of PreferredEHDataFormat because
it just returns DW_EH_PE_absptr unless on 10.6.  However, 10.6 doesn't support
PPC, so the default impl is just fine.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77724 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 20:43:26 +00:00
Chris Lattner
78a0e1bd53 remove a pointless override.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77723 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 20:36:15 +00:00
Owen Anderson
a7235ea724 Move a few more APIs back to 2.5 forms. The only remaining ones left to change back are
metadata related, which I'm waiting on to avoid conflicting with Devang.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77721 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 20:28:14 +00:00
Dan Gohman
2a29899d74 Fix GVN's debug output, now that operator<< on Value* doesn't print
a trailing newline.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77719 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 20:24:18 +00:00
Eric Christopher
44b93ff9ad Whitespace and 80-col cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77718 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 20:07:27 +00:00
Bill Wendling
84a832f927 - Convert the rest of the DOUTs to DEBUG+errs().
- One formatting change.

No intended functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77717 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 19:52:24 +00:00
Eli Friedman
d21e55abce PR4662: Fix a crash introduced by the recent LLVMContext changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77716 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 19:36:47 +00:00
Ted Kremenek
f83146fd11 Update CMake files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77709 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 18:50:22 +00:00
Chris Lattner
a87dea4f8c switch off of 'Section' onto MCSection. We're not properly using
MCSection subclasses yet, but this is a step in the right direction.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77708 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 18:48:30 +00:00
Dan Gohman
5e5337a833 Remove Annotation.h, which is no longer used in the LLVM tree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77706 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 18:36:25 +00:00
Evan Cheng
ff6ab17619 Until we have a "ALIGN" pseudo instruction, have asm printer emitted a .align
to ensure the instruction that follows a TBB (when the number of table entries
is odd) is 2-byte aligned.
Patch by Sandeep Patel.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77705 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 18:35:56 +00:00
Dan Gohman
f266f89634 MachineFunction no longer needs Annotation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77704 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 18:35:51 +00:00
Evan Cheng
d26b14c34c - Teach TBB / TBH offset limits are 510 and 131070 respectively since the offset
is scaled by two.
- Teach GetInstSizeInBytes about TBB and TBH.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77701 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 18:28:05 +00:00
Dan Gohman
69bff07b4d Fix printing of Alloca instructions with null operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77697 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 18:23:24 +00:00
Dan Gohman
a818c30d66 Fix some problems with ASTCallbackVH in its use as a DenseMap key.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77696 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 18:21:48 +00:00
Devang Patel
b4d31306a4 Process DbgDeclareInst.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77694 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 18:18:52 +00:00
Daniel Dunbar
d5f02f65af Normalize target registration code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77692 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 18:16:53 +00:00
Dan Gohman
ad2afc2a42 Reapply r77654 with a fix: MachineFunctionPass's getAnalysisUsage
shouldn't do AU.setPreservesCFG(), because even though CodeGen passes
don't modify the LLVM IR CFG, they may modify the MachineFunction CFG,
and passes like MachineLoop are registered with isCFGOnly set to true.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77691 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 18:16:33 +00:00
Chris Lattner
f26e03bc7e refactor section construction in TLOF to be through an explicit
initialize method, which can be called when an MCContext is available.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77687 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 17:42:42 +00:00
Owen Anderson
5defacc6e6 Move getTrue() and getFalse() to 2.5-like APIs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77685 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 17:39:07 +00:00
Chris Lattner
ed47a0409b split MCSection stuff out to its own .cpp file, add a new
MCSectionWithKind subclass of MCSection.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77684 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 17:02:00 +00:00
Chris Lattner
fcdbf4ecc3 create sections with MCSection::Create instead of Context->getOrCreateSection.
This is needed to allow polymorphic sections.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77680 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 16:43:49 +00:00
Chris Lattner
82987bfe9b fix PR4650: we only track sizes for certain objects, so only put something
into the mergable section if it is one of our special cases.  This could
obviously be improved, but this is the minimal fix and restores us to the
previous behavior.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77679 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 16:17:13 +00:00
Benjamin Kramer
624f3b930d Work around a dangling pointer dereference when enumerating NamedMDNodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77675 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 14:22:13 +00:00
Benjamin Kramer
c6b79ac88e Fix a struct/class mismatch, to silence a MSVC warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77673 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 11:35:26 +00:00
Sanjiv Gupta
aa93917a5e define target names for std libcalls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77667 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 07:35:57 +00:00