Commit Graph

56688 Commits

Author SHA1 Message Date
Craig Topper
87802d52e1 Remove unused MachineInstr constructors that don't take a DebugLoc argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165382 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-07 23:03:22 +00:00
Craig Topper
14ce91cc27 Fix indentation. Remove 'else' after return. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165381 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-07 20:31:05 +00:00
Benjamin Kramer
dcf2420b07 X86: fcmov doesn't handle all possible EFLAGS, fall back to a branch for the others.
Otherwise it will try to use SSE patterns and fail horribly if sse is disabled.
Fixes PR14035.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165377 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-07 15:34:27 +00:00
Bill Wendling
b10c88f175 Move more methods out-of-line. This is in preparation for changing the internal
contents of the Attributes class over to an AttributesImpl.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165373 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-07 08:55:05 +00:00
Bob Wilson
c38b636e6e Make sure always-inline functions get inlined. <rdar://problem/12423986>
Without this change, when the estimated cost for inlining a function with
an "alwaysinline" attribute was lower than the inlining threshold, the
getInlineCost function was returning that estimated cost rather than the
special InlineCost::AlwaysInlineCost value. That is fine in the normal
inlining case, but it can fail when the inliner considers the opportunity
cost of inlining into an internal or linkonce-odr function. It may decide
not to inline the always-inline function in that case. The fix here is just
to make getInlineCost always return the special value for always-inline
functions. I ran into this building clang with libc++. Tablegen failed to
link because of an always-inline function that was not inlined. I have been
unable to reduce the testcase down to a reasonable size.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165367 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-07 01:11:19 +00:00
Jack Carter
de33227462 Adding support for instructions mfc0, mfc2, mtc0, mtc2
move from and to coprocessors 0 and 2.

Contributer: Vladimir Medic


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165351 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-06 01:17:37 +00:00
Jack Carter
2490dc6508 Minor changes based on post commit review:
Contributer: Vladimir Medic


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165350 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-06 00:53:28 +00:00
Jack Carter
10d5ff6b1d Minor changes based on post commit review:
Contributer: Vladimir Medic


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165346 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-05 23:55:28 +00:00
Bill Schmidt
b2544ece59 This patch splits apart PPCISelLowering::LowerFormalArguments_Darwin_Or_64SVR4
into separate versions for the Darwin and 64-bit SVR4 ABIs.  This will
facilitate doing more major surgery on the 64-bit SVR4 ABI in the near future.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165336 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-05 21:27:08 +00:00
Benjamin Kramer
a4b5050cf5 Remove unused but set variable flagged by GCC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165331 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-05 20:08:45 +00:00
Chad Rosier
9ba9d4d76b [ms-inline asm] Add a few typedefs to simplify future changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165324 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-05 18:41:14 +00:00
Reed Kotler
dfb8dbb4fd Patch for integer multiply, signed/unsigned, long/long long.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165322 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-05 18:27:54 +00:00
Benjamin Kramer
ebd7eabca4 Simplify code, don't or a bool with an uint64_t.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165321 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-05 18:19:44 +00:00
Benjamin Kramer
1bc03e6a05 Remove empty file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165320 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-05 17:41:49 +00:00
Micah Villmow
bf07a512f2 Implement TargetData with the DataLayout class, this will allow LLVM projects to transition to DataLayout without loosing functionality.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165318 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-05 17:02:14 +00:00
Will Schmidt
d875533b7f - Mark the BCC and BLR defs as isCodeGenOnly per error output from
llvm-tblgen -gen-asm-matcher.

 PPCInstrInfo.td |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)





git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165315 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-05 15:16:11 +00:00
NAKAMURA Takumi
0559d31c37 SROA.cpp: Fix a warning, [-Wunused-variable]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165309 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-05 13:56:23 +00:00
Duncan Sands
3372c5a50f Move this test a bit later, after the point at which we know that we either
have an alloca or a parameter, since then the alloca test should make sense
to readers, while before it probably appears too specific.  No functionality
change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165306 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-05 07:29:46 +00:00
Bill Wendling
e66f3d3ba0 Move methods out-of-line.
The internal representation of the Attributes class will be opaque. All of the
query methods will need to query the opaque class. Therefore, these methods need
to be out-of-line.
No functionality change intended.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165305 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-05 06:44:41 +00:00
Bill Wendling
1fddc9d916 Use method to query for attributes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165304 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-05 06:18:50 +00:00
Craig Topper
7a922307db Remove some encoding bits I forgot to remove from SETB_C16r and SETB_C64r in r165302.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165303 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-05 06:11:52 +00:00
Craig Topper
ff9d51b994 Move expansion of SETB_C(8/16/32/64)r from MCInstLower to ExpandPostRAPseudos and mark them as pseudos in the td file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165302 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-05 06:05:15 +00:00
Sean Silva
63554988a9 tblgen: Use appropriate LLVM-style RTTI functions.
Use isa<> or cast<> when semantically that is what is happening. Also
some trivial "style" cleanups at fix sites.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165292 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-05 03:32:00 +00:00
Sean Silva
736ceace11 tblgen: Replace uses of dynamic_cast<XXXRecTy> with dyn_cast<>.
This is a mechanical change of dynamic_cast<> to dyn_cast<>. A number of
these uses are actually more like isa<> or cast<>, and will be changed
to the semanticaly appropriate one in a future patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165291 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-05 03:31:58 +00:00
Eli Friedman
ce3da6f1d5 Make sure to generate the right kind of MDNode for enum forward declarations.
PR14029, LLVM part.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165288 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-05 01:49:14 +00:00
Evan Cheng
2a2947885a Follow up to r165072. Try a different approach: only move the load when it's going to be folded into the call. rdar://12437604
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165287 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-05 01:48:22 +00:00
Chandler Carruth
fca3f4021a Teach the new SROA a new trick. Now we zap any memcpy or memmoves which
are in fact identity operations. We detect these and kill their
partitions so that even splitting is unaffected by them. This is
particularly important because Clang relies on emitting identity memcpy
operations for struct copies, and these fold away to constants very
often after inlining.

Fixes the last big performance FIXME I have on my plate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165285 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-05 01:29:09 +00:00
Chandler Carruth
0e9da58af0 Lift the speculation visitor above all the helpers that are targeted at
the rewrite visitor to make the fact that the speculation is completely
independent a bit more clear.

I promise that this is just a cut/paste of the one visitor and adding
the annonymous namespace wrappings. The diff may look completely
preposterous, it does in git for some reason.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165284 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-05 01:29:06 +00:00
Chad Rosier
5b0f1b3763 [ms-inline asm] Add support for parsing [Intel dialect] memory operands that use
segmented registers.  Test case to come.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165275 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-04 23:59:38 +00:00
Micah Villmow
99b11484d9 Rename the Target specific passes in the DataLayout class to be Target agnostic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165270 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-04 23:01:22 +00:00
Nadav Rotem
ea2c50c041 When merging connsecutive stores, use vectors to store the constant zero.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165267 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-04 22:35:15 +00:00
Micah Villmow
e18c2ae7b2 Resubmit the copying of TargetData to DataLayout without any changes to the files, this should fix the problems and the changes to rename to DataLayout will come next.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165262 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-04 22:08:14 +00:00
Preston Gurd
8d662b59f0 This patch corrects commit 165126 by using an integer bit width instead of
a pointer to a type, in order to remove the uses of getGlobalContext().

Patch by Tyler Nowicki.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165255 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-04 21:33:40 +00:00
Jim Grosbach
837c28a840 ARM: locate user-defined text sections next to default text.
Make sure functions located in user specified text sections (via the
section attribute) are located together with the default text sections.
Otherwise, for large object files, the relocations for call instructions
are more likely to be out of range. This becomes even more likely in the
presence of LTO.

rdar://12402636

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165254 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-04 21:33:24 +00:00
Micah Villmow
a36091abcf Backing out my changes, something screwed up from my patches, starting over.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165253 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-04 21:08:50 +00:00
Micah Villmow
5afc50a7a3 Rename TargetData to DataLayout in DataLayout.cpp. This should fix a build failure from r165249 where the wrong version of the file was submitted.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165251 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-04 20:49:16 +00:00
Eric Christopher
0313ced016 Update this a bit more to represent how the prologue should work:
a) frame setup instructions define the prologue
b) we shouldn't change our location mid-stream

Add a test to make sure that the stack adjustment stays within
the prologue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165250 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-04 20:46:14 +00:00
Micah Villmow
726b88fb6a Create the DataLayout class, as a direct copy of TargetData.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165249 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-04 20:44:22 +00:00
Micah Villmow
55977f6c37 Accidently checked in the files, only wanted to copy them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165244 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-04 20:08:28 +00:00
Micah Villmow
761dc22e4b git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165243 91177308-0d34-0410-b5e6-96231b3b80d8 2012-10-04 20:06:07 +00:00
Michael Liao
7abf67a092 Add register encoding support in X86 backend
- Add 'HwEncoding' for X86 registers and call getEncodingValue() to
  retrieve their encoding values.
- This's the first step to adopt new scheme. Furthur revising is onging.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165241 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-04 19:50:43 +00:00
Jakub Staszak
eb51e95e61 Add a comment to the commit r165187.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165238 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-04 19:08:30 +00:00
Will Schmidt
916381569a - add tokens to PPCInstrInfo.td and PPCInstr64Bit.td to resolve
"Instruction 'foo' has no tokens" errors during llvm-tblgen
-gen-asm-matcher attempts.  At this time, the added
tokens are "#comment" style rather than the actual mnemonic.  This will
be revisited once the rest of the base asmparser bits get straightened
out for ppc64-elf-linux.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165237 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-04 18:14:28 +00:00
Jakob Stoklund Olesen
e6521b57cc Get MCSchedModel directly from the subtarget.
Not all targets have itineraries, but the subtarget always has an
MCSchedModel.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165236 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-04 17:30:43 +00:00
Jakob Stoklund Olesen
f43fe1d163 Switch MachineTraceMetrics to the new TargetSchedModel interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165235 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-04 17:30:40 +00:00
Will Schmidt
e37091931c test commit / whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165233 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-04 16:20:24 +00:00
Benjamin Kramer
1e21db6e83 SimplifyCFG: Enhance the "remove CFG edge that leads to null pointer dereference" optimization to also handle instructions with multiple uses.
We conservatively only check the first use to avoid walking long use chains.
This catches the common case of having both a load and a store to a pointer
supplied by a PHI node.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165232 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-04 16:11:49 +00:00
Duncan Sands
7508f946bc In my recent change to avoid use of underaligned memory I didn't notice that
cpyDest can be mutated in some cases, which would then cause a crash later if
indeed the memory was underaligned.  This brought down several buildbots, so
I guess the underaligned case is much more common than I thought!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165228 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-04 13:53:21 +00:00
Duncan Sands
ffcf6dffee The alignment of an sret parameter is known: it must be at least the
alignment of the return type.  Teach the optimizers this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165226 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-04 13:36:31 +00:00
Benjamin Kramer
e660fc15fe Hoist some grossly duplicated code from the COFF/ELF/MachO streamers into MCObjectStreamer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165225 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-04 13:12:43 +00:00