Commit Graph

48006 Commits

Author SHA1 Message Date
Jakob Stoklund Olesen 71a3a003dd Fix PR10244.
A split point inserted in a block with a landing pad successor may be
hoisted above the call to ensure that it dominates all successors. The
code that handles the rest of the basic block must take this into
account.

I am not including a test case, it would be very fragile. PR10244 comes
from building clang with exceptions enabled.

llvm-svn: 134369
2011-07-04 00:05:28 +00:00
Roman Divacky 075491f2cd Make the i64 and f64 be 64bit ABI aligned in the target description.
This is what both the ABI and clang says.

llvm-svn: 134367
2011-07-03 16:24:07 +00:00
Rafael Espindola de8fa9e1f1 Fix an easy fixme.
llvm-svn: 134364
2011-07-03 05:26:42 +00:00
Duncan Sands 4bea037504 Remove unused array.
llvm-svn: 134323
2011-07-02 16:36:24 +00:00
Duncan Sands a1c44332e5 Revert previous commit. It seems that whether casting to void
is valid or not depends on which system you build.

llvm-svn: 134321
2011-07-02 13:14:22 +00:00
Duncan Sands dda99eef54 Supress gcc-4.5 warning about the result not being used.
llvm-svn: 134319
2011-07-02 13:06:23 +00:00
Rafael Espindola ed33752769 Use getVNInfoAt.
llvm-svn: 134312
2011-07-02 07:50:27 +00:00
Jakob Stoklund Olesen e925f22b40 Consistent diagnostic capitalization and redundant context elimination.
llvm-svn: 134311
2011-07-02 07:23:40 +00:00
Jakob Stoklund Olesen 54f7c59c1a Better diagnostics when inline asm fails to allocate.
asm.c:2:7: error: ran out of registers during register allocation
  asm(""::"r"(0), "r"(1), "r"(2), "r"(3), "r"(4), "r"(5), "r"(6), "r"(7), "r"(8), "r"(9));
        ^

llvm-svn: 134310
2011-07-02 07:17:37 +00:00
Rafael Espindola 36e11ff819 Check the VN of the src register at the two copies, not just the
register number.

llvm-svn: 134309
2011-07-02 05:34:02 +00:00
Jakob Stoklund Olesen 25a404eb81 Include a source location when complaining about bad inline assembly.
Add a MI->emitError() method that the backend can use to report errors
related to inline assembly. Call it from X86FloatingPoint.cpp when the
constraints are wrong.

This enables proper clang diagnostics from the backend:

$ clang -c pr30848.c
pr30848.c:5:12: error: Inline asm output regs must be last on the x87 stack
  __asm__ ("" : "=u" (d));  /* { dg-error "output regs" } */
           ^
1 error generated.

llvm-svn: 134307
2011-07-02 03:53:34 +00:00
Andrew Trick 6d12309475 indvars -disable-iv-rewrite: bug fix involving weird geps and related cleanup.
llvm-svn: 134306
2011-07-02 02:34:25 +00:00
Jakob Stoklund Olesen 30a8563a61 Use a new strategy for preventing eviction loops in RAGreedy.
Every live range is assigned a cascade number the first time it is
involved in an eviction. As the evictor, it gets a new cascade number.
Every evictee is assigned the same cascade number as the evictor.

Eviction is prohibited if the evictor has a lower assigned cascade
number than the evictee.

This means that assigned cascade numbers are monotonically increasing
with every eviction, yet they are bounded by NextCascade which can only
be incremented by new live ranges. Thus, infinite loops cannot happen,
but eviction cascades can still be triggered by new live ranges as we
want.

Thanks to Andy for explaining this to me.

llvm-svn: 134303
2011-07-02 01:37:09 +00:00
Evan Cheng fb71f4260a Add getFeatureBits to extract feature bits for a given CPU.
llvm-svn: 134298
2011-07-02 00:43:44 +00:00
Cameron Zwarich 7da0f9a58e Take a stab at fixing the llvm-x86_64-linux-checks failure.
llvm-svn: 134287
2011-07-01 23:45:21 +00:00
Eric Christopher a8a56f7e5c TargetConstant immediates won't be placed into registers so tighten
up the valid constant check earlier.

rdar://9692967

llvm-svn: 134286
2011-07-01 23:04:38 +00:00
Douglas Gregor de3c92674e Add initial *-*-rtems* target, from Joel Sherrill
llvm-svn: 134282
2011-07-01 22:41:06 +00:00
Evan Cheng c9c090d7a5 Rename XXXGenSubtarget.inc to XXXGenSubtargetInfo.inc for consistency.
llvm-svn: 134281
2011-07-01 22:36:09 +00:00
Evan Cheng 0711c4d489 Add MCSubtargetInfo target registry stuff.
llvm-svn: 134279
2011-07-01 22:25:04 +00:00
Dan Gohman a293f24a0d Teach IVUsers to stop at non-affine expressions unless they are both
outside the loop and reducible.

This more completely hides them from LSR, which isn't usually able to
do anything meaningful with non-affine expressions anyway, and this
consequently hides them from SCEVExpander, which is acutely unprepared
for non-affine expressions.

Replace test/CodeGen/X86/lsr-nonaffine.ll with a new test that tests
the new behavior.

This works around the bug in PR10117 / rdar://problem/9633149, and is
generally an improvement besides.

llvm-svn: 134268
2011-07-01 22:05:19 +00:00
Owen Anderson 2f37bdc392 Generalize @llvm.ctlz, @llvm.cttz, and @llvm.ctpop to work on vectors of integers, and fix the one optimization pass that I'm aware of that needs updating for this. At least one current target, ARM NEON, can implement these operations on vectors directly.
llvm-svn: 134265
2011-07-01 21:52:38 +00:00
Eli Friedman d24a7da658 Calling-convention specifications for illegal types are no-ops. Simplify based on this.
llvm-svn: 134264
2011-07-01 21:33:28 +00:00
Jim Grosbach cf1464d943 ARMv7M vs. ARMv7E-M support.
The DSP instructions in the Thumb2 instruction set are an optional extension
in the Cortex-M* archtitecture. When present, the implementation is considered
an "ARMv7E-M implementation," and when not, an "ARMv7-M implementation."

Add a subtarget feature hook for the v7e-m instructions and hook it up. The
cortex-m3 cpu is an example of a v7m implementation, while the cortex-m4 is
a v7e-m implementation.

rdar://9572992

llvm-svn: 134261
2011-07-01 21:12:19 +00:00
Evan Cheng 0d639a28aa Rename TargetSubtarget to TargetSubtargetInfo for consistency.
llvm-svn: 134259
2011-07-01 21:01:15 +00:00
Evan Cheng 54b68e3432 - Added MCSubtargetInfo to capture subtarget features and scheduling
itineraries.
- Refactor TargetSubtarget to be based on MCSubtargetInfo.
- Change tablegen generated subtarget info to initialize MCSubtargetInfo
  and hide more details from targets.

llvm-svn: 134257
2011-07-01 20:45:01 +00:00
Jim Grosbach 68b0e8456e Fix off-by-one error.
(low two bits always zero, so off by one bit of encoded value).

llvm-svn: 134247
2011-07-01 19:07:09 +00:00
Evan Cheng 703a0fbf39 Hide the call to InitMCInstrInfo into tblgen generated ctor.
llvm-svn: 134244
2011-07-01 17:57:27 +00:00
Jim Grosbach 4def704a21 Pseudo-ize t2MOVCC[ri].
t2MOVCC[ri] are just t2MOV[ri] instructions, so properly pseudo-ize them.
The Thumb1 versions, tMOVCC[ri] were only present for use by the size-
reduction pass, so they're no longer necessary at all and can be deleted.

llvm-svn: 134242
2011-07-01 17:14:11 +00:00
Evan Cheng c88d6d402a Eliminate one extra conversion.
llvm-svn: 134240
2011-07-01 16:59:30 +00:00
Duncan Sands bc9e523421 Disable commit 134216 ("Add 134199 back, but disable the optimization when the second
copy is a kill") to see if it fixes the i386 dragonegg buildbot, which is timing out
because gcc built with dragonegg is going into an infinite loop.

llvm-svn: 134237
2011-07-01 12:01:00 +00:00
Francois Pichet 92da450ae7 Another misuse of StringRef. MSVC is very sensitive to that kind of error.
llvm-svn: 134236
2011-07-01 09:23:41 +00:00
Nick Lewycky f64a39768d Fix likely typo, reduce number of instruction name collisions.
llvm-svn: 134235
2011-07-01 06:27:03 +00:00
Rafael Espindola 968af4fee2 Fix use after free.
llvm-svn: 134234
2011-07-01 04:40:50 +00:00
Rafael Espindola 760e51079a Avoid DenseMap lookup.
llvm-svn: 134231
2011-07-01 04:15:02 +00:00
Rafael Espindola 475cd405b0 Fix off by one error. I misunderstood the comment about killedAt.
llvm-svn: 134229
2011-07-01 03:31:29 +00:00
Rafael Espindola 59066f0da0 Check the liveinterval, not the kill flag.
llvm-svn: 134228
2011-07-01 02:35:06 +00:00
Jakob Stoklund Olesen 39af582c57 Don't inflate register classes used by inline asm.
The constraints are represented by the register class of the original
virtual register created for the inline asm. If the register class were
included in the operand descriptor, we might be able to do this.

For now, just give up on regclass inflation when inline asm is involved.

No test case, this bug hasn't happened yet.

llvm-svn: 134226
2011-07-01 01:24:25 +00:00
Akira Hatanaka f2bcad972d Improve Mips back-end's handling of DBG_VALUE.
llvm-svn: 134224
2011-07-01 01:04:43 +00:00
Dan Gohman 54664ed714 Improve constant folding of undef for cmp and select operators.
llvm-svn: 134223
2011-07-01 01:03:43 +00:00
Eric Christopher 29f1db85dd Add support for the 'j' immediate constraint. This is conditionalized on
supporting the instruction that the constraint is for 'movw'.

Part of rdar://9119939

llvm-svn: 134222
2011-07-01 01:00:07 +00:00
Dan Gohman ca8d9e1341 Improve constant folding of undef for binary operators.
llvm-svn: 134221
2011-07-01 00:42:17 +00:00
Eric Christopher c011d31543 Add support for the ARM 't' register constraint. And another testcase
for the 'x' register constraint.

Part of rdar://9119939

llvm-svn: 134220
2011-07-01 00:30:46 +00:00
Evan Cheng d8e27a584e Switch SubtargetFeatures from std::string to StringRef.
llvm-svn: 134219
2011-07-01 00:23:10 +00:00
Eric Christopher f09b0f1043 We'll return a null RC by default if we can't match.
Part of rdar://9119939

llvm-svn: 134217
2011-07-01 00:19:27 +00:00
Rafael Espindola 4b522de5c0 Add 134199 back, but disable the optimization when the second copy is a kill.
llvm-svn: 134216
2011-07-01 00:16:54 +00:00
Eric Christopher f1c74595aa Add support for the 'x' constraint.
Part of rdar://9307836 and rdar://9119939

llvm-svn: 134215
2011-07-01 00:14:47 +00:00
Bill Wendling c737ac1816 Remove tabs.
llvm-svn: 134212
2011-06-30 23:59:38 +00:00
Eric Christopher 1f054f27af Capitalize the unsigned part of the initializer.
llvm-svn: 134211
2011-06-30 23:59:16 +00:00
Eric Christopher cf2007ca78 Rename Pair to RCPair lacking any better naming ideas.
llvm-svn: 134210
2011-06-30 23:50:52 +00:00
Bill Wendling 40cc749788 Improve comment: Show the register the DWARF label is added to.
llvm-svn: 134209
2011-06-30 23:47:40 +00:00