Commit Graph

14849 Commits

Author SHA1 Message Date
Chad Rosier
b875acda98 [ms-inline asm] Remove a redundant call to the setHasMSInlineAsm function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175456 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-18 20:13:59 +00:00
NAKAMURA Takumi
3ef669c717 [ms-inline asm] Fix undefined behavior to reset hasMSInlineAsm in advance of SelectAllBasicBlocks().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175422 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-18 07:06:48 +00:00
Cameron Zwarich
680c98f632 Remove use of reverse iterators in repairIntervalsInRange(). While they were
arguably better than forward iterators for this use case, they are confusing and
there are some implementation problems with reverse iterators and MI bundles.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175393 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-17 11:09:00 +00:00
Cameron Zwarich
7324d4e593 Use ArrayRef instead of a reference to a SmallVectorImpl.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175385 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-17 03:48:23 +00:00
Cameron Zwarich
0c22283598 Fix a conversion from a forward iterator to a reverse iterator in
MachineBasicBlock::SplitCriticalEdge. Since this is an iterator rather than
an instr_iterator, the isBundled() check only passes if getFirstTerminator()
returned end() and the garbage memory happens to lean that way.

Multiple successors can be present without any terminator instructions in the
case of exception handling with a fallthrough.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175383 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-17 01:45:04 +00:00
Cameron Zwarich
f0b2535344 Add support for updating the LiveIntervals of registers used by 'exotic'
terminators that actually have register uses when splitting critical edges.

This commit also introduces a method repairIntervalsInRange() on LiveIntervals,
which allows for repairing LiveIntervals in a small range after an arbitrary
target hook modifies, inserts, and removes instructions. It's pretty limited
right now, but I hope to extend it to support all of the things that are done
by the convertToThreeAddress() target hooks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175382 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-17 00:10:44 +00:00
Benjamin Kramer
eb4774a972 Replace erase loop with std::remove_if.
This avoids unnecessary copies. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175367 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-16 17:06:38 +00:00
Benjamin Kramer
81474e98e1 Replace loop with std::find.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175366 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-16 17:06:32 +00:00
Jakub Staszak
631dd86804 LegalizeDAG.cpp doesn't need DenseMap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175365 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-16 16:15:42 +00:00
Jakub Staszak
b717a50847 Use const reference instead of vector object when passing an argument to
updateScheduledPressure method.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175362 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-16 15:47:26 +00:00
Chad Rosier
b56606274d [ms-inline asm] Do not omit the frame pointer if we have ms-inline assembly.
If the frame pointer is omitted, and any stack changes occur in the inline
assembly, e.g.: "pusha", then any C local variable or C argument references
will be incorrect.  

I pass no judgement on anyone who would do such a thing. ;)
rdar://13218191

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175334 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-16 01:25:28 +00:00
Bill Wendling
789cb5df9c Use the 'target-features' and 'target-cpu' attributes to reset the subtarget features.
If two functions require different features (e.g., `-mno-sse' vs. `-msse') then
we want to honor that, especially during LTO. We can do that by resetting the
subtarget's features depending upon the 'target-feature' attribute.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175314 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-15 22:31:27 +00:00
Paul Redmond
86cdbc9c29 enable SDISel sincos optimization for GNU environments
- add sincos to runtime library if target triple environment is GNU
- added canCombineSinCosLibcall() which checks that sincos is in the RTL and
  if the environment is GNU then unsafe fpmath is enabled (required to
  preserve errno)
- extended sincos-opt lit test

Reviewed by: Hal Finkel


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175283 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-15 18:45:18 +00:00
Benjamin Kramer
74b3c8da48 Make helpers static. Add missing include so LLVMInitializeObjCARCOpts gets C linkage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175264 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-15 12:30:38 +00:00
Nadav Rotem
6cc4b8d1eb Dont merge consecutive loads/stores into vectors when noimplicitfloat is used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175190 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-14 18:28:52 +00:00
Owen Anderson
39125d9a3a Add some legality checks for SETCC before introducing it in the DAG combiner post-operand legalization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175149 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-14 09:07:33 +00:00
Cameron Zwarich
1f258a6d53 RegisterCoalescer::reMaterializeTrivialDef() can constrain the destination
register class to match the defining instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175130 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-14 03:25:24 +00:00
Cameron Zwarich
1d46732281 Fix RegisterCoalescer::rematerializeTrivialDef() so that it works on flipped
CoalescerPairs. Also, make it take a CoalescerPair directly like other methods
of RegisterCoalescer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175123 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-14 02:51:05 +00:00
Cameron Zwarich
c5f147459b Fix some issues with rematerialization in RegisterCoalescer when the destination
of the copy is a subregister def. The current code assumes that it can do a full
def of the destination register, but it is not checking that the def operand is
read-undef. It also doesn't clear the subregister index of the destination in
the new instruction to reflect the full subregister def.

These issues were found running 'make check' with my next commit that enables
rematerialization in more cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175122 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-14 02:51:03 +00:00
Manman Ren
f098620095 Clean up LDV, no functionality change.
Remove dead functions: renameRegister
Move private member variables from LDV to Impl
Remove ssp/uwtable from testing case


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175072 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-13 20:23:48 +00:00
Andrew Trick
ecb8c2ba60 MIsched: HazardRecognizers are created for each DAG. Free them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175067 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-13 19:22:27 +00:00
Eric Christopher
b3cecdfcf9 Fix comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175024 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-13 02:29:18 +00:00
Manman Ren
4be3853fd0 Debug Info: LiveDebugVarible can remove DBG_VALUEs, make sure we emit them back.
RegisterCoalescer used to depend on LiveDebugVariable. LDV removes DBG_VALUEs
without emitting them at the end.

We fix this by removing LDV from RegisterCoalescer. Also add an assertion to
make sure we call emitDebugValues if DBG_VALUEs are removed at
runOnMachineFunction.

rdar://problem/13183203
Reviewed by Andy & Jakob


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175023 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-13 01:14:49 +00:00
Guy Benyei
87d0b9ed14 Add static cast to unsigned char whenever a character classification function is called with a signed char argument, in order to avoid assertions in Windows Debug configuration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175006 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-12 21:21:59 +00:00
Krzysztof Parzyszek
c5ef7eee3c Allow optionally generating pubnames section in DWARF info. Introduce
option "generate-dwarf-pubnames" to control it, set to "false" by default.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174981 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-12 18:00:14 +00:00
Sergei Larin
91231a6dc7 Equal treatment of labels and other terminators in MI DAG construction.
MI sched DAG construction allows targets to include terminators into scheduling DAG.
Extend this functionality to labels as well.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174977 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-12 16:36:03 +00:00
Paul Redmond
5c97450df7 PR14562 - Truncation of left shift became undef
DAGCombiner::ReduceLoadWidth was converting (trunc i32 (shl i64 v, 32))
into (shl i32 v, 32) into undef. To prevent this, check the shift count
against the final result size.

Patch by: Kevin Schoedel
Reviewed by: Nadav Rotem


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174972 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-12 15:21:21 +00:00
Cameron Zwarich
4930e7266b Don't consider definitions by other PHIs live-in when trimming a PHI source's
live range after inserting a copy at the end of a block.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174945 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-12 05:48:58 +00:00
Cameron Zwarich
8d49134eea Fix indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174944 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-12 05:48:56 +00:00
Cameron Zwarich
5758a711f4 Add a hidden option to PHIElimination to split all critical edges. This is
particularly useful for catching issues with architectures that have exotic
terminators like MIPS.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174938 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-12 03:49:25 +00:00
Cameron Zwarich
dd58fa4869 Add blocks to the LiveIntervalAnalysis RegMaskBlocks array when splitting
a critical edge.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174936 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-12 03:49:20 +00:00
Cameron Zwarich
dbf10c4349 Fix the updating of LiveIntervals after splitting a critical edge. PHI operand
live ranges should always be extended, and the only successor that should be
considered for extension of other ranges is the target of the split edge.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174935 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-12 03:49:17 +00:00
Pete Cooper
b0fde6dc02 Check type for legality before forming a select from loads.
Sorry for the lack of a test case.  I tried writing one for i386 as i know selects are illegal on this target, but they are actually considered legal by isel and expanded later.

I can't see any targets to trigger this, but checking for the legality of a node before forming it is general goodness.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174934 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-12 03:14:50 +00:00
Cameron Zwarich
8597c14e9b Add support for updating LiveIntervals to MachineBasicBlock::SplitCriticalEdge().
This is currently a bit hairier than it needs to be, since depending on where the
split block resides the end ListEntry of the split block may be the end ListEntry
of the original block or a new entry. Some changes to the SlotIndexes updating
should make it possible to eliminate the two cases here.

This also isn't as optimized as it could be. In the future Liveinterval should
probably get a flag that indicates whether the LiveInterval is within a single
basic block. We could ignore all such intervals when splitting an edge.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174870 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-11 09:24:47 +00:00
Cameron Zwarich
cbe3f5e162 Update SlotIndexes after updateTerminator() possibly removes instructions. I am
really trying to avoid piping SlotIndexes through to RemoveBranch() and friends.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174869 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-11 09:24:45 +00:00
Bob Wilson
f64c889cc9 Revert "Rename LLVMContext diagnostic handler types and functions."
This reverts my commit 171047. Now that I've removed my misguided attempt to
support backend warnings, these diagnostics are only about inline assembly.
It would take quite a bit more work to generalize them properly, so I'm
just reverting this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174860 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-11 05:37:07 +00:00
Evan Cheng
092e5e7566 Currently, codegen may spent some time in SDISel passes even if an entire
function is successfully handled by fast-isel. That's because function
arguments are *always* handled by SDISel. Introduce FastLowerArguments to
allow each target to provide hook to handle formal argument lowering.

As a proof-of-concept, add ARMFastIsel::FastLowerArguments to handle
functions with 4 or fewer scalar integer (i8, i16, or i32) arguments. It
completely eliminates the need for SDISel for trivial functions.

rdar://13163905


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174855 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-11 01:27:15 +00:00
Evan Cheng
5f352cc6e4 Remove unnecessary code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174854 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-11 01:18:26 +00:00
Cameron Zwarich
f5844a7515 Fix the unused but nearly correct method SlotIndexes::insertMBBInMaps() and add
support for updating SlotIndexes to MachineBasicBlock::SplitCriticalEdge(). This
calls renumberIndexes() every time; it should be improved to only renumber
locally.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174851 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-10 23:29:54 +00:00
Cameron Zwarich
36f54480f8 Abstract the liveness checking in PHIElimination::SplitPHIEdges() to support
both LiveVariables and LiveIntervals.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174850 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-10 23:29:49 +00:00
Cameron Zwarich
b7cfac32f3 Add support for updating LiveIntervals to PHIElimination. If LiveIntervals are
present, it currently verifies them with the MachineVerifier, and this passed
all of the test cases in 'make check' (when accounting for existing verifier
errors). There were some assertion failures in the two-address pass, but they
also happened on code without phis and look like they are caused by different
kill flags from LiveIntervals.

The only part that doesn't work is the critical edge splitting heuristic,
because there isn't currently an efficient way to update LiveIntervals after
splitting an edge. I'll probably start by implementing the slow fallback and
test that it works before tackling the fast path for single-block ranges. The
existing code that updates LiveVariables is fairly slow as it is.

There isn't a command-line option for enabling this; instead, just edit
PHIElimination.cpp to require LiveIntervals.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174831 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-10 06:42:36 +00:00
Cameron Zwarich
d7c7a686ac Fix a typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174830 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-10 06:42:34 +00:00
Cameron Zwarich
02513c05c6 Remove ancient references to 'atomic' phis in PHIElimination that don't really
make sense anymore.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174829 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-10 06:42:32 +00:00
Cameron Zwarich
fe0fd35d53 Make LiveVariables an instance variable of PHIElimination.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174828 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-10 06:42:30 +00:00
Jakub Staszak
7dcb23a052 Remove unneeded "TargetMachine.h" #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174817 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-09 20:54:05 +00:00
Manman Ren
f2d89ff5c8 Dwarf: do not use line_table_start in at_stmt_list since we do not always emit
line table entries in assembly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174785 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-09 00:41:44 +00:00
Jakob Stoklund Olesen
ec7b25d753 Remove the old liveness algorithm.
This is part of the plan to delete LiveVariables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174783 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-09 00:04:07 +00:00
Jakob Stoklund Olesen
ea871523ec Turn on -new-live-intervals by default.
This uses a liveness algorithm that does not depend on data from the
LiveVariables analysis, it is the first step towards removing
LiveVariables completely.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174774 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-08 23:18:37 +00:00
Bob Wilson
58446916b7 Revert "Add LLVMContext::emitWarning methods and use them. <rdar://problem/12867368>"
This reverts r171041. This was a nice idea that didn't work out well.
Clang warnings need to be associated with warning groups so that they can
be selectively disabled, promoted to errors, etc. This simplistic patch didn't
allow for that. Enhancing it to provide some way for the backend to specify
a front-end warning type seems like overkill for the few uses of this, at
least for now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174748 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-08 21:48:29 +00:00
Hal Finkel
089a5f8a8c DAGCombiner: Constant folding around pre-increment loads/stores
Previously, even when a pre-increment load or store was generated,
we often needed to keep a copy of the original base register for use
with other offsets. If all of these offsets are constants (including
the offset which was combined into the addressing mode), then this is
clearly unnecessary. This change adjusts these other offsets to use the
new incremented address.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174746 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-08 21:35:47 +00:00
Bob Wilson
8f637adbd3 Revert 172027 and 174336. Remove diagnostics about over-aligned stack objects.
Aside from the question of whether we report a warning or an error when we
can't satisfy a requested stack object alignment, the current implementation
of this is not good.  We're not providing any source location in the diagnostics
and the current warning is not connected to any warning group so you can't
control it.  We could improve the source location somewhat, but we can do a
much better job if this check is implemented in the front-end, so let's do that
instead.  <rdar://problem/13127907>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174741 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-08 20:35:15 +00:00
Arnold Schwaighofer
fb55a8fd7c ARM cost model: Address computation in vector mem ops not free
Adds a function to target transform info to query for the cost of address
computation. The cost model analysis pass now also queries this interface.
The code in LoopVectorize adds the cost of address computation as part of the
memory instruction cost calculation. Only there, we know whether the instruction
will be scalarized or not.
Increase the penality for inserting in to D registers on swift. This becomes
necessary because we now always assume that address computation has a cost and
three is a closer value to the architecture.

radar://13097204

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174713 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-08 14:50:48 +00:00
Eric Christopher
7a0103c30d "Clean up" line section symbol emission by emitting the section
syms before constructing the compile units so we're not emitting
section references to sections not there already.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174663 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-07 21:19:50 +00:00
Eric Christopher
01776a5a94 Clean up multiple skeleton compile units if we have multiple compile
units coming in.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174548 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-06 21:53:56 +00:00
Eric Christopher
231b83d8fd Remove some dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174547 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-06 21:53:53 +00:00
Evan Cheng
607acd66f4 Tweak check to avoid integer overflow (for insanely large alignments)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174482 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-06 02:06:33 +00:00
Manman Ren
9c5861fdbd Attempt to recover gdb bot after r174445.
Failure: undefined symbol 'Lline_table_start0'.
Root-cause: we use a symbol subtraction to calculate at_stmt_list, but
the line table entries are not dumped in the assembly.
Fix: use zero instead of a symbol subtraction for Compile Unit 0.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174479 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-06 00:59:41 +00:00
Manman Ren
43213cf1ac Dwarf: support for LTO where a single object file can have multiple line tables
We generate one line table for each compilation unit in the object file.
Reviewed by Eric and Kevin.

rdar://problem/13067005


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174445 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-05 21:52:47 +00:00
Owen Anderson
b48783b091 Reapply r174343, with a fix for a scary DAG combine bug where it failed to differentiate between the alignment of the
base point of a load, and the overall alignment of the load.  This caused infinite loops in DAG combine with the
original application of this patch.

ORIGINAL COMMIT LOG:
When the target-independent DAGCombiner inferred a higher alignment for a load,
it would replace the load with one with the higher alignment.  However, it did
not place the new load in the worklist, which prevented later DAG combines in
the same phase (for example, target-specific combines) from ever seeing it.

This patch corrects that oversight, and updates some tests whose output changed
due to slightly different DAGCombine outputs.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174431 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-05 19:24:39 +00:00
Jakob Stoklund Olesen
e6dc59891f Remove liveout lists from MachineRegisterInfo.
All targets are now adding return value registers as implicit uses on
return instructions, and there is no longer a need for the live out
lists.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174417 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-05 18:21:56 +00:00
Jakob Stoklund Olesen
b45e4deb10 Remove special-casing of return blocks for liveness.
Now that return value registers are return instruction uses, there is no
need for special treatment of return blocks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174416 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-05 18:21:52 +00:00
NAKAMURA Takumi
eb260b2527 Revert r174343, "When the target-independent DAGCombiner inferred a higher alignment for a load,"
It caused hangups in compiling clang/lib/Parse/ParseDecl.cpp and clang/lib/Driver/Tools.cpp in stage2 on some hosts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174374 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-05 14:44:16 +00:00
Eric Christopher
31fb5dafce Construct a skeleton cu for each compile unit in the module, not just
for the first compile unit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174352 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-05 07:32:03 +00:00
Eric Christopher
208cc6f489 Add support for emitting a stub DW_AT_GNU_dwo_id as part of the
DWARF5 split dwarf proposal.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174350 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-05 07:31:55 +00:00
Owen Anderson
429f7ef0c1 When the target-independent DAGCombiner inferred a higher alignment for a load,
it would replace the load with one with the higher alignment.  However, it did
not place the new load in the worklist, which prevented later DAG combines in
the same phase (for example, target-specific combines) from ever seeing it.

This patch corrects that oversight, and updates some tests whose output changed
due to slightly different DAGCombine outputs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174343 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-05 06:25:30 +00:00
Manman Ren
91b978e157 [Stack Alignment] emit warning instead of a hard error
Per discussion in rdar://13127907, we should emit a hard error only if
people write code where the requested alignment is larger than achievable
and assumes the low bits are zeros. A warning should be good enough when
we are not sure if the source code assumes the low bits are zeros.

rdar://13127907


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174336 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-04 23:45:08 +00:00
Benjamin Kramer
4969310052 SelectionDAG: Teach FoldConstantArithmetic how to deal with vectors.
This required disabling a PowerPC optimization that did the following:
input:
x = BUILD_VECTOR <i32 16, i32 16, i32 16, i32 16>
lowered to:
tmp = BUILD_VECTOR <i32 8, i32 8, i32 8, i32 8>
x = ADD tmp, tmp

The add now gets folded immediately and we're back at the BUILD_VECTOR we
started from. I don't see a way to fix this currently so I left it disabled
for now.

Fix some trivially foldable X86 tests too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174325 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-04 15:19:18 +00:00
Shuxin Yang
98b93e5a94 rdar://13126763
Fix a bug in DAGCombine. The symptom is mistakenly optimizing expression
"x + x*x" into "x * 3.0".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174239 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-02 00:22:03 +00:00
Manman Ren
7650d9b893 Correct indentation for dumping LexicalScope.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174237 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-02 00:02:03 +00:00
Manman Ren
945e828003 [Dwarf] avoid emitting multiple AT_const_value for static memebers.
Testing case is reduced from MultiSource/BenchMarks/Prolangs-C++/deriv1.

rdar://problem/13071590


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174235 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-01 23:54:37 +00:00
Nadav Rotem
5882e566a5 Fix errant fallthrough in the generation of the lifetime markers.
Found by Alexander Kornienko.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174207 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-01 19:25:23 +00:00
Chad Rosier
5fb7947ed1 Use a continue to simplify loop and reduce indentation. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174198 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-01 17:49:07 +00:00
Chad Rosier
3ab115ce8f Add braces, so my head doesn't explode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174088 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-31 20:57:50 +00:00
Lang Hames
2d95e43fd8 When lowering memcpys to loads and stores, make sure we don't promote alignments
past the natural stack alignment.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174085 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-31 20:23:43 +00:00
Manman Ren
8b15d74434 [Dwarf] early exit to avoid creating dangling DIEs
We used to create children DIEs for a scope, then check whether ScopeDIE is
null. If ScopeDIE is null, the children DIEs will be dangling. Other DIEs can
link to those dangling DIEs, which are not emitted at all, causing dwarf error.

The current testing case is 4k lines, from MultiSource/BenchMark/McCat/09-vor.

rdar://problem/13071959


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174084 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-31 20:05:14 +00:00
Chad Rosier
108fb3202a [PEI] Pass the frame index operand number to the eliminateFrameIndex function.
Each target implementation was needlessly recomputing the index.
Part of rdar://13076458

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174083 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-31 20:02:54 +00:00
Weiming Zhao
f662a59b8b Add a special handling case for untyped CopyFromReg node in GetCostForDef() of ScheduleDAGRRList
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173833 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29 21:18:43 +00:00
David Blaikie
aaf2e639ec Support artificial parameters in function types.
Provides the functionality for Clang change r172911 - I just had this still
lying around.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173820 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29 19:35:24 +00:00
Edwin Vane
f1af1feeee Fixing warnings revealed by gcc release build
Fixed set-but-not-used warnings.

Reviewer: gribozavr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173810 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29 17:42:24 +00:00
Andrew Trick
4c6a2ba4e0 MIsched: cleanup code. Use isBoundaryNode().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173775 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29 06:26:35 +00:00
Evan Cheng
8688a58c53 Teach SDISel to combine fsin / fcos into a fsincos node if the following
conditions are met:
1. They share the same operand and are in the same BB.
2. Both outputs are used.
3. The target has a native instruction that maps to ISD::FSINCOS node or
   the target provides a sincos library call.

Implemented the generic optimization in sdisel and enabled it for
Mac OSX. Also added an additional optimization for x86_64 Mac OSX by
using an alternative entry point __sincos_stret which returns the two
results in xmm0 / xmm1.

rdar://13087969
PR13204


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173755 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29 02:32:37 +00:00
Bill Schmidt
5ff776bfde This patch addresses bug 15031.
The common code in the post-RA scheduler to break anti-dependencies on the
critical path contained a flaw.  In the reported case, an anti-dependency
between the overlapping registers %X4 and %R4 exists:

	%X29<def> = OR8 %X4, %X4
	%R4<def>, %X3<def,dead,tied3> = LBZU 1, %X3<kill,tied1>

The unpatched code breaks the dependency by replacing %R4 and its uses
with %R3, the first register on the available list.  However, %R3 and
%X3 overlap, so this creates two overlapping definitions on the same
instruction.

The fix is straightforward, preventing selection of a register that
overlaps any other defined register on the same instruction.

The test case is reduced from the bug report, and verifies that we no
longer produce "lbzu 3, 1(3)" when breaking this anti-dependency.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173706 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-28 18:36:58 +00:00
Eric Christopher
498703bcfb Fix comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173698 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-28 17:33:26 +00:00
Michael Gottesman
24c4898973 Extracted ObjCARC.cpp into its own library libLLVMObjCARCOpts in preparation for refactoring the ARC Optimizer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173647 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-28 01:35:51 +00:00
Benjamin Kramer
0fef46f50e Legalizer: Reword comment again, per Duncan's suggestion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173625 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-27 21:02:52 +00:00
Benjamin Kramer
022688c260 Legalizer: Add an assert and tweak a comment to clarify the assumptions this code makes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173620 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-27 15:04:43 +00:00
Benjamin Kramer
914f8c4825 When the legalizer is splitting vector shifts, the result may not have the right shift amount type.
Fix that by adding a cast to the shift expander. This came up with vector shifts
on sse-less X86 CPUs.

   <2 x i64>       = shl <2 x i64> <2 x i64>
-> i64,i64         = shl i64 i64; shl i64 i64
-> i32,i32,i32,i32 = shl_parts i32 i32 i64; shl_parts i32 i32 i64

Now we cast the last two i64s to the right type. Fixes the crash in PR14668.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173615 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-27 11:19:11 +00:00
Jakub Staszak
b74564a15a Use const reference instead of vector copying.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173497 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 21:44:27 +00:00
Preston Gurd
ea387fc3b8 This patch aims to reduce compile time in LegalizeTypes by using SmallDenseMap,
with an initial number of elements,  instead of DenseMap, which has
zero initial elements, in order to avoid the copying of elements
when the size changes and to avoid allocating space every time
LegalizeTypes is run. This patch will not affect the memory footprint,
because DenseMap will increase the element size to 64
when the first element is added.

Patch by Wan Xiaofei.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173448 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 15:18:54 +00:00
Andrew Trick
c855423ff2 MIsched: Print block name. No functionality.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173433 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 07:45:31 +00:00
Andrew Trick
3084979ff2 MachineScheduler support for viewGraph.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173432 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 07:45:29 +00:00
Andrew Trick
c6ada8e5f3 ScheduleDAG: colorize the DOT graph and improve formatting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173431 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 07:45:25 +00:00
Andrew Trick
a5a73ad159 ScheduleDAG: Added isBoundaryNode to conveniently detect a common corner case.
This fixes DAG subtree analysis at the boundary.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173427 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 06:52:30 +00:00
Andrew Trick
988d06b0e5 SchedDFS: Complete support for nested subtrees.
Maintain separate per-node and per-tree book-keeping.
Track all instructions above a DAG node including nested subtrees.
Seperately track instructions within a subtree.
Record subtree parents.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173426 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 06:52:27 +00:00
Andrew Trick
4e1fb18940 MIsched: Improve the interface to SchedDFS analysis (subtrees).
Allow the strategy to select SchedDFS. Allow the results of SchedDFS
to affect initialization of the scheduler state.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173425 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 06:33:57 +00:00
Andrew Trick
bfb8223e2b SchedDFS: Initial support for nested subtrees.
This is mostly refactoring, along with adding an instruction count
within the subtrees and ensuring we only look at data edges.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173420 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 06:02:44 +00:00
Andrew Trick
178f7d08a4 MISched: Add SchedDFSResult to ScheduleDAGMI to formalize the
interface and allow other strategies to select it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173413 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 04:01:04 +00:00
Andrew Trick
b12a771992 SchedDFS: Refactor and tweak the subtree selection criteria.
For sanity, create a root when NumDataSuccs >= 4. Splitting large
subtrees will no longer be detrimental after my next checkin to handle
nested tree. A magic number of 4 is fine because single subtrees
seldom rejoin more than this. It makes subtrees easier to visualize
and heuristics more sane.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173399 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 00:12:57 +00:00
Jakob Stoklund Olesen
dd4fc446b5 Avoid creating duplicate CFG edges in the IfConversion pass.
Patch by Stefan Hepp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173395 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-24 23:59:08 +00:00
Andrew Trick
db4170697f MachineScheduler: enable biasCriticalPath for all DAGs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173318 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-24 02:09:57 +00:00
Andrew Trick
66658dd9a1 MIsched: Added biasCriticalPath.
Allow schedulers to order DAG edges by critical path. This makes
DFS-based heuristics more stable and effective.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173317 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-24 02:09:55 +00:00
Bill Wendling
e4957fb9b7 Add the heuristic to differentiate SSPStrong from SSPRequired.
The requirements of the strong heuristic are:

* A Protector is required for functions which contain an array, regardless of
  type or length.

* A Protector is required for functions which contain a structure/union which
  contains an array, regardless of type or length.  Note, there is no limit to
  the depth of nesting.

* A protector is required when the address of a local variable (i.e., stack
  based variable) is exposed. (E.g., such as through a local whose address is
  taken as part of the RHS of an assignment or a local whose address is taken as
  part of a function argument.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173231 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-23 06:43:53 +00:00
Bill Wendling
114baee1fa Add the IR attribute 'sspstrong'.
SSPStrong applies a heuristic to insert stack protectors in these situations:

* A Protector is required for functions which contain an array, regardless of
  type or length.

* A Protector is required for functions which contain a structure/union which
  contains an array, regardless of type or length.  Note, there is no limit to
  the depth of nesting.

* A protector is required when the address of a local variable (i.e., stack
  based variable) is exposed. (E.g., such as through a local whose address is
  taken as part of the RHS of an assignment or a local whose address is taken as
  part of a function argument.)

This patch implements the SSPString attribute to be equivalent to
SSPRequired. This will change in a subsequent patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173230 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-23 06:41:41 +00:00
Tim Northover
0a29cb0454 Make APFloat constructor require explicit semantics.
Previously we tried to infer it from the bit width size, with an added
IsIEEE argument for the PPC/IEEE 128-bit case, which had a default
value. This default value allowed bugs to creep in, where it was
inappropriate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173138 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-22 09:46:31 +00:00
Michael Ilseman
afe77f33b2 Introduce a new data structure, the SparseMultiSet, and changes to the MI scheduler to use it.
A SparseMultiSet adds multiset behavior to SparseSet, while retaining SparseSet's desirable properties. Essentially, SparseMultiSet provides multiset behavior by storing its dense data in doubly linked lists that are inlined into the dense vector. This allows it to provide good data locality as well as vector-like constant-time clear() and fast constant time find(), insert(), and erase(). It also allows SparseMultiSet to have a builtin recycler rather than keeping SparseSet's behavior of always swapping upon removal, which allows it to preserve more iterators. It's often a better alternative to a SparseSet of a growable container or vector-of-vector.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173064 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21 18:18:53 +00:00
Nadav Rotem
0c8607ba6a Revert 172708.
The optimization handles esoteric cases but adds a lot of complexity both to the X86 backend and to other backends.
This optimization disables an important canonicalization of chains of SEXT nodes and makes SEXT and ZEXT asymmetrical.
Disabling the canonicalization of consecutive SEXT nodes into a single node disables other DAG optimizations that assume
that there is only one SEXT node. The AVX mask optimizations is one example. Additionally this optimization does not update the cost model.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172968 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-20 08:35:56 +00:00
David Blaikie
1426841672 The last of PR14471 - emission of constant floats
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172941 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-20 01:18:01 +00:00
Eric Christopher
0969ddf601 Split out DW_OP_addr for the split debug info DWARF5 proposal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172857 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 22:11:33 +00:00
Bill Wendling
1b0c54f1c5 Use AttributeSet accessor methods instead of Attribute accessor methods.
Further encapsulation of the Attribute object. Don't allow direct access to the
Attribute object as an aggregate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172853 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 21:53:16 +00:00
Bill Wendling
1a17bd21ff Remove unused parameter. Also use the AttributeSet query methods instead of the Attribute query methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172852 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 21:50:24 +00:00
Daniel Dunbar
6d49b680be [MC/Mach-O] Implement integrated assembler support for linker options.
- Also, fixup syntax errors in LangRef and missing newline in the MCAsmStreamer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172837 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 19:37:00 +00:00
Elena Demikhovsky
6c327f92a5 Optimization for the following SIGN_EXTEND pairs:
v8i8  -> v8i64, 
v8i8  -> v8i32, 
v4i8  -> v4i64, 
v4i16 -> v4i64 
for AVX and AVX2.

Bug 14865.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172708 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-17 09:59:53 +00:00
Eric Christopher
446b88fb81 Fix the assembly and dissassembly of DW_FORM_sec_offset. Found this by
changing both the string of the dwo_name to be correct and the type of
the statement list.

Testcases all around.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172699 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-17 03:00:04 +00:00
Eric Christopher
d96c72a14c Add the DW_AT_GNU_addr_base for the skeleton cu. Add support for
emitting the dwarf32 version of DW_FORM_sec_offset and correct
disassembler support.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172698 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-17 02:59:59 +00:00
Jakob Stoklund Olesen
5ed625c3cf Move MachineTraceMetrics.h into include/llvm/CodeGen.
Let targets use it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172688 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-17 01:06:04 +00:00
Jakob Stoklund Olesen
02c6325a45 Provide a place for targets to insert ILP optimization passes.
Move the early if-conversion pass into this group.

ILP optimizations usually need to find the right balance between
register pressure and ILP using the MachineTraceMetrics analysis to
identify critical paths and estimate other costs. Such passes should run
together so they can share dominator tree and loop info analyses.

Besides if-conversion, future passes to run here here could include
expression height reduction and ARM's MLxExpansion pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172687 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-17 00:58:38 +00:00
Eric Christopher
6b6061f011 Define metadata interfaces for describing a static data member
of a class. Emit static data member declarations and definitions
through correctly.

Part of PR14471.

Patch by Paul Robinson!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172590 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-16 01:22:23 +00:00
Eric Christopher
72f7bfbf0e Split address information for DWARF5 split dwarf proposal. This involves
using the DW_FORM_GNU_addr_index and a separate .debug_addr section which
stays in the executable and is fully linked.

Sneak in two other small changes:

a) Print out the debug_str_offsets.dwo section.
b) Change form we're expecting the entries in the debug_str_offsets.dwo
   section to take from ULEB128 to U32.

Add tests for all of this in the fission-cu.ll test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172578 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-15 23:56:56 +00:00
Bill Schmidt
89e88e30bf This patch addresses an incorrect transformation in the DAG combiner.
The included test case is derived from one of the GCC compatibility tests.
The problem arises after the selection DAG has been converted to type-legalized
form.  The combiner first sees a 64-bit load that can be converted into a
pre-increment form.  The original load feeds into a SRL that isolates the
upper 32 bits of the loaded doubleword.  This looks like an opportunity for
DAGCombiner::ReduceLoadWidth() to replace the 64-bit load with a 32-bit load.

However, this transformation is not valid, as the replacement load is not
a pre-increment load.  The pre-increment load produces an extra result,
which feeds a subsequent add instruction.  The replacement load only has
one result value, and this value is propagated to all uses of the pre-
increment load, including the add.  Because the add is looking for the
second result value as its operand, it ends up attempting to add a constant
to a token chain, resulting in a crash.

So the patch simply disables this transformation for any load with more than
two result values.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172480 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-14 22:04:38 +00:00
Benjamin Kramer
4dc478308f When lowering an inreg sext first shift left, then right arithmetically.
Shifting right two times will only yield zero. Should fix
SingleSource/UnitTests/SignlessTypes/factor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172322 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-12 19:06:44 +00:00
Jakob Stoklund Olesen
6d6132986d Limit the search space in RAGreedy::tryEvict().
When tryEvict() is looking for a cheaper register in the allocation
order, skip the tail of too expensive registers when possible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172281 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-12 00:57:44 +00:00
Jakob Stoklund Olesen
c7a275245f Precompute some information about register costs.
Remember the minimum cost of the registers in an allocation order and
the number of registers at the end of the allocation order that have the
same cost per use.

This information can be used to limit the search space for
RAGreedy::tryEvict() when looking for a cheaper register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172280 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-12 00:54:59 +00:00
Nadav Rotem
66de2af815 PPC: Implement efficient lowering of sign_extend_inreg.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172269 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-11 22:57:48 +00:00
Benjamin Kramer
8ecd3be1f3 Remove some accidentaly duplicated code. This needs urgent cleanup :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172248 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-11 20:11:33 +00:00
Benjamin Kramer
69e42dbd00 Split TargetLowering into a CodeGen and a SelectionDAG part.
This fixes some of the cycles between libCodeGen and libSelectionDAG. It's still
a complete mess but as long as the edges consist of virtual call it doesn't
cause breakage. BasicTTI did static calls and thus broke some build
configurations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172246 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-11 20:05:37 +00:00
Nadav Rotem
3e40d927a7 ARM Cost Model: Modify the target independent cost model to ask
the target if it supports the different CAST types. We didn't do this
on X86 because of the different register sizes and types, but on ARM
this makes sense.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172245 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-11 19:54:13 +00:00
Eric Christopher
fffe363493 For inline asm:
- recognize string "{memory}" in the MI generation
- mark as mayload/maystore when there's a memory clobber constraint.

PR14859.

Patch by Krzysztof Parzyszek

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172228 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-11 18:12:39 +00:00
Andrew Trick
eed4e0193f Follow-up typo correction from building the wrong branch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172224 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-11 17:51:16 +00:00
Andrew Trick
e9ccacd376 Fix typo from r170452. Affects -enable-misched heuristics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172223 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-11 17:46:50 +00:00
Tim Northover
5f2801bd65 Simplify writing floating types to assembly.
This removes previous special cases for each floating-point type in favour of a
shared codepath.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172189 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-11 10:36:13 +00:00
Evan Cheng
4ff23d09fa PR14896: Handle memcpy from constant string where the memcpy size is larger than the string size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172124 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-10 22:13:27 +00:00
Jakub Staszak
81bfd711de Remove unneeded includes from FunctionLoweringInfo.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172123 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-10 22:13:13 +00:00
Jakob Stoklund Olesen
4aebce8321 Allow hasProperty() to be called on bundle-internal instructions.
When calling hasProperty() on an instruction inside a bundle, it should
always behave as if IgnoreBundle was passed, and just return properties
for the current instruction.

Only attempt to aggregate bundle properties whan asked about the bundle
header.

The assertion fires on existing ARM test cases without this fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172082 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-10 18:42:44 +00:00
Jakob Stoklund Olesen
b11f050434 Support headerless bundles in MachineInstr::hasProperty().
This function can still work without a BUNDLE header instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172029 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-10 01:29:42 +00:00
Manman Ren
86441169da Stack Alignment: throw error if we can't satisfy the minimal alignment
requirement when creating stack objects in MachineFrameInfo.

Add CreateStackObjectWithMinAlign to throw error when the minimal alignment
can't be achieved and to clamp the alignment when the preferred alignment
can't be achieved. Same is true for CreateVariableSizedObject.
Will not emit error in CreateSpillStackObject or CreateStackObject.

As long as callers of CreateStackObject do not assume the object will be
aligned at the requested alignment, we should not have miscompile since
later optimizations which look at the object's alignment will have the correct
information.

rdar://12713765


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172027 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-10 01:10:10 +00:00
Nadav Rotem
14925e6b88 ARM Cost model: Use the size of vector registers and widest vectorizable instruction to determine the max vectorization factor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172010 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-09 22:29:00 +00:00
Evan Cheng
78ec0255d9 Fix a DAG combine bug visitBRCOND() is transforming br(xor(x, y)) to br(x != y).
It cahced XOR's operands before calling visitXOR() but failed to update the
operands when visitXOR changed the XOR node.

rdar://12968664


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171999 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-09 20:56:40 +00:00
Jakob Stoklund Olesen
ebed123c5c Don't print bundle flags.
The bundle flags are used by MachineBasicBlock::print(), they don't need
to clutter up individual MachineInstrs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171986 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-09 18:35:09 +00:00
Jakob Stoklund Olesen
25377c8c6d Don't require BUNDLE headers in MachineInstr::getBundleSize().
It is possible to build MI bundles that don't begin with a BUNDLE
header. Add support for such bundles, counting all instructions inside
the bundle.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171985 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-09 18:28:16 +00:00
Sergei Larin
12cd49ae1d Fix a typo in MachineInstr::unbundleFromSucc() method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171983 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-09 17:54:33 +00:00
Tim Northover
2c8cf4b404 Refactor to expose RTLIB calls to targets.
fp128 is almost but not quite completely illegal as a type on AArch64. As a
result it needs to have a register class (for argument passing mainly), but all
operations need to be lowered to runtime calls. Currently there's no way for
targets to do this (without duplicating code), as the relevant functions are
hidden in SelectionDAG. This patch changes that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171971 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-09 13:18:15 +00:00
Eric Christopher
1ced208be9 Last in the series of removing unnecessary '0' arguments for
address space. Reordered the EmitULEB128IntValue arguments to
make this easier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171949 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-09 03:52:05 +00:00
Andrew Trick
47579cf390 MIsched: add an ILP window property to machine model.
This was an experimental option, but needs to be defined
per-target. e.g. PPC A2 needs to aggressively hide latency.

I converted some in-order scheduling tests to A2. Hal is working on
more test cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171946 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-09 03:36:49 +00:00
Eric Christopher
68ca56285f These functions have default arguments of 0 for the last arg. Use
them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171933 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-09 01:57:54 +00:00
Eric Christopher
ca1dd05c3c These functions have default arguments of 0 for the last arg. Use
them and add one where it seemed obvious that we wanted one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171932 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-09 01:35:34 +00:00
Nadav Rotem
83be7b0dd3 Cost Model: Move the 'max unroll factor' variable to the TTI and add initial Cost Model support on ARM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171928 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-09 01:15:42 +00:00
Eric Christopher
b6714227ed Move the string pools down into the units. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171905 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-08 22:22:06 +00:00
Tim Northover
24d315dc05 Add fp128 rtlib function names to LLVM
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171867 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-08 17:09:59 +00:00
Tim Northover
90f011e0ba Allow the asm printer to print fp128 values properly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171866 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-08 16:56:23 +00:00
Chandler Carruth
40b2c32475 Sink a function that refers to the SelectionDAG into that library in the
one file where it is called as a static function. Nuke the declaration
and the definition in lib/CodeGen, along with the include of
SelectionDAG.h from this file.

There is no dependency edge from lib/CodeGen to
lib/CodeGen/SelectionDAG, so it isn't valid for a routine in lib/CodeGen
to reference the DAG. There is a dependency from
lib/CodeGen/SelectionDAG on lib/CodeGen. This breaks one violation of
this layering.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171842 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-08 05:11:57 +00:00