Commit Graph

85500 Commits

Author SHA1 Message Date
Chandler Carruth
322e9ba2cb Fix an issue where we failed to adjust the alignment constraint on
a memcpy to reflect that '0' has a different meaning when applied to
a load or store. Now we correctly use underaligned loads and stores for
the test case added.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165101 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-03 08:26:28 +00:00
Chandler Carruth
f710fb14ee Try to use a better set of abstractions for computing the alignment
necessary during rewriting. As part of this, fix a real think-o here
where we might have left off an alignment specification when the address
is in fact underaligned. I haven't come up with any way to trigger this,
as there is always some other factor that reduces the alignment, but it
certainly might have been an observable bug in some way I can't think
of. This also slightly changes the strategy for placing explicit
alignments on loads and stores to only do so when the alignment does not
match that required by the ABI. This causes a few redundant alignments
to go away from test cases.

I've also added a couple of tests that really push on the alignment that
we end up with on loads and stores. More to come here as I try to fix an
underlying bug I have conjectured and produced test cases for, although
it's not clear if this bug is the one currently hitting dragonegg's
gcc47 bootstrap.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165100 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-03 08:14:02 +00:00
Eric Christopher
76ad43c6e1 Revert 165051-165049 while looking into the foreach.m failure in
more detail.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165099 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-03 08:10:01 +00:00
Craig Topper
8e8f8724e1 Fix doxygen comment to match function name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165094 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-03 06:47:18 +00:00
Craig Topper
3138659646 Remove unused function that used to get itineraries from SubTargetFeatures. This is done from MCSubTargetInfo these days.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165092 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-03 06:26:11 +00:00
Craig Topper
12d57c0b85 Fix 80-column violation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165089 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-03 03:56:12 +00:00
NAKAMURA Takumi
44a1fd4843 test/ExecutionEngine/MCJIT: MCJIT should work also on mingw.
FIXME: Also cygwin?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165081 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-03 01:42:37 +00:00
Chandler Carruth
de2fae4c7b Third try at fixing this. ;] Go back to using std::remove_if, which has
most of the behavior we want, but wrap the predicate in one which erases
elements from the set if they pass the predicate. Oh what I wouldn't
give for a lambda here.

Let me know if the predicate wrapping is too much magic. ;]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165076 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-03 01:04:07 +00:00
Jakob Stoklund Olesen
0d141f867d The early if conversion pass is ready to be used as an opt-in.
Enable the pass by default for targets that request it, and change the
-enable-early-ifcvt to the opposite -disable-early-ifcvt.

There are still some x86 regressions when enabling early if-conversion
because of the missing machine models. Disable the pass for x86 until
machine models are added.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165075 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-03 00:51:32 +00:00
Chandler Carruth
75eac5f0eb Switch the SetVector::remove_if implementation to use partition which
preserves the values of the relocated entries, unlikely remove_if. This
allows walking them and erasing them.

Also flesh out the predicate we are using for this to support the
various constraints actually imposed on a UnaryPredicate -- without this
we can't compose it with std::not1.

Thanks to Sean Silva for the review here and noticing the issue with
std::remove_if.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165073 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-03 00:03:00 +00:00
Evan Cheng
2b87e06d26 Fix a serious X86 instruction selection bug. In
X86DAGToDAGISel::PreprocessISelDAG(), isel is moving load inside
callseq_start / callseq_end so it can be folded into a call. This can
create a cycle in the DAG when the call is glued to a copytoreg. We
have been lucky this hasn't caused too many issues because the pre-ra
scheduler has special handling of call sequences. However, it has
caused a crash in a specific tailcall case.

rdar://12393897


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165072 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-02 23:49:13 +00:00
Eric Christopher
394820b8e1 Revert "Don't use a debug location for frame setup instructions in the"
This reverts 165055 and 165052 temporarily while I look at debugger
failures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165071 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-02 23:43:11 +00:00
Chad Rosier
f9e008bf67 Revert 165057, per Jim's request. This requires further discussion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165069 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-02 23:38:50 +00:00
Jack Carter
8e71e617c9 The mips 64bit instructions DSLL, DSRA, DSRL, DEXT and DINS get transformed by the assembler or through codegen direct object output to other variants based on the value of the immediate values of the operands.
If the code is generated as assembler, this transformation does not occur assuming that it will occur later in the assembler.

This code was originally called from  MipsAsmPrinter.cpp and we needed to check for OutStreamer.hasRawTextSupport(). This was not a good place for it and has been moved to MCTargetDesc/MipsMCCodeEmitter.cpp where both direct object and the assembler use it it automagically.

The test cases have been checked in for a number of weeks now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165067 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-02 23:09:40 +00:00
Chandler Carruth
5c5b3cf5b8 Teach the new SROA to handle cases where an alloca that has already been
scheduled for processing on the worklist eventually gets deleted while
we are processing another alloca, fixing the original test case in
PR13990.

To facilitate this, add a remove_if helper to the SetVector abstraction.
It's not easy to use the standard abstractions for this because of the
specifics of SetVectors types and implementation.

Finally, a nice small test case is included. Thanks to Benjamin for the
fantastic reduced test case here! All I had to do was delete some empty
basic blocks!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165065 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-02 22:46:45 +00:00
Chandler Carruth
5d37976090 Clean up these doxygen comments to follow the proposed new style. This
also makes it more consistent with Clang and several passes' doxygen
style.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165064 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-02 22:46:40 +00:00
Nick Lewycky
b09649b335 Make sure to put our sret argument into %rax on x86-64. Fixes PR13563!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165063 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-02 22:45:06 +00:00
Jakob Stoklund Olesen
6c0c6d613a Remove the old coalescer algorithm.
The new algorithm has been enabled by default for almost a week now and
seems to be stable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165062 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-02 22:45:03 +00:00
Jakob Stoklund Olesen
d4919a988d Handle reserved registers more accurately in handleMove().
Reserved register live ranges look like a set of dead defs - any uses of
reserved registers are ignored.

Instead of skipping the updating of reserved register operands entirely,
just ignore the use operands and treat the def operands normally.

No test case, handleMove() is not commonly used yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165060 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-02 22:08:36 +00:00
Chad Rosier
95707c90cc [ms-inline asm] Add basic support for wildcard MCParsedAsmOperands. This type
of operand is specific to MS-style inline assembly and should not be generated
when parsing normal assembly.

The purpose of the wildcard operands are to allow the AsmParser to match
multiple instructions (i.e., MCInsts) to a given ms-style asm statement.  For
the time being the matcher just returns the first match.  This patch only
implements wildcard matches for memory operands.  Support for register
wildcards will be added in the near future.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165057 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-02 21:49:07 +00:00
Jakob Stoklund Olesen
27cb347d0e Make sure the whole live range is covered when values are pruned twice.
JoinVals::pruneValues() calls LIS->pruneValue() to avoid conflicts when
overlapping two different values. This produces a set of live range end
points that are used to reconstruct the live range (with SSA update)
after joining the two registers.

When a value is pruned twice, the set of end points was insufficient:

  v1 = DEF
  v1 = REPLACE1
  v1 = REPLACE2
  KILL v1

The end point at KILL would only reconstruct the live range from
REPLACE2 to KILL, leaving the range REPLACE1-REPLACE2 dead.

Add REPLACE2 as an end point in this case so the full live range is
reconstructed.

This fixes PR13999.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165056 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-02 21:46:39 +00:00
Eric Christopher
abe704309f Allow alternate instructions to silence bot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165055 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-02 21:44:16 +00:00
Eric Christopher
55c86c67ee 80-col.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165054 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-02 21:44:12 +00:00
Andrew Kaylor
3f23cef24f Clean-up of memory buffer and object ownership model in MCJIT
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165053 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-02 21:18:39 +00:00
Eric Christopher
9fd304672c Don't use a debug location for frame setup instructions in the
prologue. Also skip frame setup instructions when looking for the
first location.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165052 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-02 21:17:00 +00:00
Eric Christopher
138f206146 Use the existing DebugLoc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165051 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-02 21:16:55 +00:00
Eric Christopher
2d4d0f0ee8 Make the location a parameter since we may not want the next one
in the block.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165050 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-02 21:16:53 +00:00
Eric Christopher
96bd4418b2 Remove the SavePoint infrastructure from fast isel, replace
with just an insert point from the MachineBasicBlock and let
the location be updated as we access it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165049 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-02 21:16:50 +00:00
Bill Wendling
df5f0fbc27 Set the 'build clang only' flag when we're building only clang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165042 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-02 20:32:23 +00:00
Nick Kledzik
6e033d6dcd Improve overflow detection in StringRef::getAsUnsignedInteger().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165038 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-02 20:01:48 +00:00
Chandler Carruth
fdb15850e6 Fix another crasher in SROA, reported by Joel.
We require that the indices into the use lists are stable in order to
build fast lookup tables to locate a particular partition use from an
operand of a PHI or select. This is (obviously in hind sight)
incompatible with erasing elements from the array. Really, we don't want
to erase anyways. It is expensive, and a rare operation. Instead, simply
weaken the contract of the PartitionUse structure to allow null Use
pointers to represent dead uses. Now we can clear out the pointer to
mark things as dead, and all it requires is adding some 'continue'
checks to the various loops.

I'm still reducing a test case for this, as the test case I have is
huge. I think this one I can get a nice test case for though, as it was
much more deterministic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165032 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-02 18:57:13 +00:00
Andrew Kaylor
7bbd6e366b Support for generating ELF objects on Windows.
This adds 'elf' as a recognized target triple environment value and overrides the default generated object format on Windows platforms if that value is present.  This patch also enables MCJIT tests on Windows using the new environment value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165030 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-02 18:38:34 +00:00
Chandler Carruth
a346f46271 Fix a silly coding error on my part. The whole point of the speculator
being separate was that it can grow the use list. As a consequence, we
can't use the iterator-pair interface, we need an index based interface.
Expose such an interface from the AllocaPartitioning, and use it in the
speculator.

This should at least fix a use-after-free bug found by Duncan, and may
fix some of the other crashers.

I don't have a nice deterministic test case yet, but if I get a good
one, I'll add it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165027 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-02 17:49:47 +00:00
Benjamin Kramer
fba80d9e97 Fix broken tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165019 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-02 15:49:34 +00:00
Duncan Sands
48da0be8b5 Fix PR13991: legalizing an overflowing multiplication operation is harder than
the add/sub case since in the case of multiplication you also have to check that
the operation in the larger type did not overflow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165017 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-02 15:03:49 +00:00
James Molloy
9e36496eb3 Add default JIT LIT variable.
Patch by David Tweed!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164996 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-02 10:57:08 +00:00
Chandler Carruth
1fe4fae463 Turn the new SROA pass back on. Let's see if it sticks this time. =]
Again, let me know if anything breaks due to this!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164986 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-02 04:24:01 +00:00
Chad Rosier
c69bb70deb Fix 80-column violations. Cleanup whitespace in generated code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164983 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-02 00:25:57 +00:00
Chad Rosier
22685876ed [ms-inline asm] Add the convertToMapAndConstraints() function that is used to
map constraints and MCInst operands to inline asm operands.  This replaces the
getMCInstOperandNum() function.

The logic to determine the constraints are not in place, so we still default to
a register constraint (i.e., "r"). Also, we no longer build the MCInst but
rather return just the opcode to get the MCInstrDesc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164979 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-01 23:45:51 +00:00
NAKAMURA Takumi
3fc42fd77c test/CodeGen/X86/red-zone2.ll: Add -mtriple=x86_64-linux, and FileCheck-ize.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164975 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-01 22:48:07 +00:00
Jim Grosbach
b4316028b3 MachO: direct-to-object attribute for data-in-code markers.
The target backend can support data-in-code load commands even when
the assembler doesn't, or vice-versa. Allow targets to opt-in for
direct-to-object.

PR13973.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164974 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-01 22:20:54 +00:00
Reed Kotler
0585b38088 checking test case for r164811. was an omission to not check this in. this was already approved
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164972 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-01 21:35:06 +00:00
Chad Rosier
17be8a51b0 [ms-inline asm] Expose the getReg() function in the base class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164969 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-01 20:53:03 +00:00
Michael J. Spencer
06d9981d27 [Docs] Update File Headers section to cover doxygen style file level docs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164964 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-01 19:59:21 +00:00
Jordan Rose
92080529a0 Re-enable support for --program-prefix.
The Apple buildbots have been modified not to pass --target,
so they shouldn't choke on a default program prefix anymore.

Patch by Rick Foos!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164956 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-01 18:40:32 +00:00
Micah Villmow
7744345a71 Forgot the SPIR test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164949 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-01 17:07:51 +00:00
Micah Villmow
e53d6051b7 Add in support for SPIR to LLVM core. This adds a new target and two new calling conventions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164948 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-01 17:01:31 +00:00
Michael Liao
3118937305 Fix PR13899
- Update maximal stack alignment when stack arguments are prepared before a
  call.
- Test cases are enhanced to show it's not a Win32 specific issue but a generic
  one.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164946 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-01 16:44:04 +00:00
Benjamin Kramer
f0070f2a97 Provide a shortcut for MCObjectStreamer when emitting fills.
Reduces runtime of i386-large-relocations.s by 10x in Release builds, even more
in Debug+Asserts builds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164945 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-01 15:14:14 +00:00
Chandler Carruth
cfb65293c3 Fix more misspellings found by Duncan during review.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164940 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-01 12:30:45 +00:00