1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 20:12:56 +02:00
Commit Graph

12342 Commits

Author SHA1 Message Date
Johnny Chen
d530046ed3 Set Rm bits of BX_RET to 0b1110 (R14); and set condition code bits of BRIND to
0b1110 (ALways).  This is so that the disassembler decoder can distinguish among
BX_RET, BRIND, and BXr9.

llvm-svn: 89000
2009-11-16 23:57:56 +00:00
Jeffrey Yasskin
0f846dbb3e Make X86-64 in the Large model always emit 64-bit calls.
The large code model is documented at
http://www.x86-64.org/documentation/abi.pdf and says that calls should
assume their target doesn't live within the 32-bit pc-relative offset
that fits in the call instruction.

To do this, we turn off the global-address->target-global-address
conversion in X86TargetLowering::LowerCall(). The first attempt at
this broke the lazy JIT because it can separate the movabs(imm->reg)
from the actual call instruction. The lazy JIT receives the address of
the movabs as a relocation and needs to record the return address from
the call; and then when that call happens, it needs to patch the
movabs with the newly-compiled target. We could thread the call
instruction into the relocation and record the movabs<->call mapping
explicitly, but that seems to require at least as much new
complication in the code generator as this change.

To fix this, we make lazy functions _always_ go through a call
stub. You'd think we'd only have to force lazy calls through a stub on
difficult platforms, but that turns out to break indirect calls
through a function pointer. The right fix for that is to distinguish
between calls and address-of operations on uncompiled functions, but
that's complex enough to leave for someone else to do.

Another attempt at this defined a new CALL64i pseudo-instruction,
which expanded to a 2-instruction sequence in the assembly output and
was special-cased in the X86CodeEmitter's emitInstruction()
function. That broke indirect calls in the same way as above.

This patch also removes a hack forcing Darwin to the small code model.
Without far-call-stubs, the small code model requires things of the
JITMemoryManager that the DefaultJITMemoryManager can't provide.

Thanks to echristo for lots of testing!

llvm-svn: 88984
2009-11-16 22:41:33 +00:00
Evan Cheng
78be20d62e - Check memoperand alignment instead of checking stack alignment. Most load / store folding instructions are not referencing spill stack slots.
- Mark MOVUPSrm re-materializable.

llvm-svn: 88974
2009-11-16 21:56:03 +00:00
Jim Grosbach
2c6e8c5ccc Make the pass class name more explicit.
llvm-svn: 88964
2009-11-16 21:13:22 +00:00
Jim Grosbach
736ee00309 make pass name a bit more clear
llvm-svn: 88961
2009-11-16 21:03:58 +00:00
Jim Grosbach
62cd0707dd Simplify thumb2 jump table adjustments. Remove unnecessary calculation and
usage of block sizes and offsets.

llvm-svn: 88935
2009-11-16 18:58:52 +00:00
Jim Grosbach
eef0542edc clarify comment
llvm-svn: 88933
2009-11-16 18:55:47 +00:00
Jim Grosbach
2d074ac39b back off for a bit. tracking down weirdness
llvm-svn: 88919
2009-11-16 17:17:48 +00:00
Jim Grosbach
71539bfab0 Analyze has to be before checking the condition, obviously. Properly construct an iterator for prior.
llvm-svn: 88917
2009-11-16 17:10:56 +00:00
Bruno Cardoso Lopes
f87fd996e2 Disable ldc1/sdc1 instructions for mips1 targets.
llvm-svn: 88887
2009-11-16 04:35:29 +00:00
Bruno Cardoso Lopes
21ca44ba49 - Fix a small bug while handling target constant pools (one param was missing).
- Add a smarter constant pool loading, instead of:

lui $2, %hi($CPI1_0)
addiu $2, $2, %lo($CPI1_0)
lwc1 $f0, 0($2)

Generate:

lui $2, %hi($CPI1_0)
lwc1 $f0, %lo($CPI1_0)($2)

llvm-svn: 88886
2009-11-16 04:33:42 +00:00
Jim Grosbach
1aa571da3c Detect need for autoalignment of the stack earlier to catch spills more
conservatively. eliminateFrameIndex() machinery adjust to handle addr mode
6 (vld1/vst1) used for spills. Fix tests to expect aligned Q-reg spilling

llvm-svn: 88874
2009-11-15 21:45:34 +00:00
Jim Grosbach
8e55bb8826 set the def of the VLD1q64 properly
llvm-svn: 88873
2009-11-15 21:05:07 +00:00
Nick Lewycky
b73208f294 Add a complex missed optimization opportunity I came across while investigating
bug 5438.

llvm-svn: 88855
2009-11-15 17:51:23 +00:00
Jim Grosbach
4882bbfe05 cleanup.
llvm-svn: 88812
2009-11-14 21:33:37 +00:00
Jim Grosbach
4175b4fbf2 Cleanup flow, and only update the jump table we're analyzing when replacing a destination MBB.
llvm-svn: 88805
2009-11-14 20:10:18 +00:00
Richard Osborne
8748f55236 Add XCore support for arbitrary-sized aggregate returns.
llvm-svn: 88802
2009-11-14 19:33:35 +00:00
Anton Korobeynikov
b290c6b8f7 Temporary disable the error - it seems to be too conservative.
llvm-svn: 88800
2009-11-14 18:01:41 +00:00
Daniel Dunbar
59040c2825 Add llvm::sys::getHostCPUName, for detecting the LLVM name for the host CPU.
- This is an initial step towards -march=native support in Clang, and towards
   eliminating host dependencies in the targets. See PR5389.

 - Patch by Roman Divacky!

llvm-svn: 88768
2009-11-14 10:09:12 +00:00
Sanjiv Gupta
b38d6287b8 revert 88761 as it fails builds.
llvm-svn: 88762
2009-11-14 07:22:25 +00:00
Sanjiv Gupta
3db18af363 Fix debug info crashes for PIC16.
llvm-svn: 88761
2009-11-14 06:19:49 +00:00
Evan Cheng
9b46e74f42 - Change TargetInstrInfo::reMaterialize to pass in TargetRegisterInfo.
- If destination is a physical register and it has a subreg index, use the
  sub-register instead.
This fixes PR5423.

llvm-svn: 88745
2009-11-14 02:55:43 +00:00
Evan Cheng
e43198c166 When expanding t2STRDi8 r, r to two stores, add kill markers correctly.
llvm-svn: 88734
2009-11-14 01:50:00 +00:00
Jakob Stoklund Olesen
a077364caa The instruction pointer %RIP is a reserved register on x86_64.
llvm-svn: 88705
2009-11-13 21:56:01 +00:00
David Greene
97a1f550d1 Move DebugInfo checks into EmitComments and remove them from
target-specific AsmPrinters.  Not all comments need DebugInfo.

Re-enable the line numbers comment test.

llvm-svn: 88697
2009-11-13 21:34:57 +00:00
David Goodwin
e1d06f2239 Allow target to specify regclass for which antideps will only be broken along the critical path.
llvm-svn: 88682
2009-11-13 19:52:48 +00:00
Bruno Cardoso Lopes
e3686712f7 Support fp64 immediate zero, this fixes only part of PR5445
because the testcase is triggering one more bug.

llvm-svn: 88674
2009-11-13 18:49:59 +00:00
Dale Johannesen
f57a58c4fe Adjust isConstantSplat to allow for big-endian targets.
PPC is such a target; make it work.

llvm-svn: 87060
2009-11-13 01:45:18 +00:00
Jim Grosbach
c15c777f81 Block renumbering
llvm-svn: 87056
2009-11-13 01:19:24 +00:00
Jim Grosbach
85faa3cff1 use lower case for readability
llvm-svn: 87054
2009-11-13 01:17:22 +00:00
David Greene
1a5969d74c Fix a bootstrap failure.
Provide special isLoadFromStackSlotPostFE and isStoreToStackSlotPostFE
interfaces to explicitly request checking for post-frame ptr elimination
operands.  This uses a heuristic so it isn't reliable for correctness.

llvm-svn: 87047
2009-11-13 00:29:53 +00:00
David Greene
9934b1d063 Make the MachineFunction argument of getFrameRegister const.
This also fixes a build error.

llvm-svn: 87027
2009-11-12 21:00:03 +00:00
David Greene
ea251ed2b9 Add hasLoadFromStackSlot and hasStoreToStackSlot to return whether a
machine instruction loads or stores from/to a stack slot.  Unlike
isLoadFromStackSlot and isStoreFromStackSlot, the instruction may be
something other than a pure load/store (e.g. it may be an arithmetic
operation with a memory operand).  This helps AsmPrinter determine when
to print a spill/reload comment.

This is only a hint since we may not be able to figure this out in all
cases.  As such, it should not be relied upon for correctness.

Implement for X86.  Return false by default for other architectures.

llvm-svn: 87026
2009-11-12 20:55:29 +00:00
David Greene
58e7c6145b Add a bool flag to StackObjects telling whether they reference spill
slots.  The AsmPrinter will use this information to determine whether to
print a spill/reload comment.

Remove default argument values.  It's too easy to pass a wrong argument
value when multiple arguments have default values.  Make everything
explicit to trap bugs early.

Update all targets to adhere to the new interfaces..

llvm-svn: 87022
2009-11-12 20:49:22 +00:00
Benjamin Kramer
da70783da7 Add compare_lower and equals_lower methods to StringRef. Switch all users of
StringsEqualNoCase (from StringExtras.h) to it.

llvm-svn: 87020
2009-11-12 20:36:59 +00:00
Jim Grosbach
79f45fa2e6 Update TB[BH] layout optimization. Add support for moving the target block
to directly follow the jump table. Move the layout changes to prior to any
constant island handling.

llvm-svn: 86999
2009-11-12 17:25:07 +00:00
Evan Cheng
a47f2ea71d Use table to separate opcode from operands.
llvm-svn: 86965
2009-11-12 07:16:34 +00:00
Evan Cheng
af90768b3c isLegalICmpImmediate should take a signed integer; code clean up.
llvm-svn: 86964
2009-11-12 07:13:11 +00:00
Jim Grosbach
66e301e3ca Revert 86857. It's causing consumer-typeset to fail, and there's a better way to do it forthcoming anyway.
llvm-svn: 86945
2009-11-12 03:28:35 +00:00
Bruno Cardoso Lopes
99e65b8707 A real solution for the first part of PR5445
llvm-svn: 86895
2009-11-11 23:09:33 +00:00
Evan Cheng
a11308742c Add TargetLowering::isLegalICmpImmediate. It tells LSR what immediate can be folded into target icmp instructions.
llvm-svn: 86858
2009-11-11 19:05:52 +00:00
Jim Grosbach
9ecdde2be4 Do jump table adjustment before constant island allocation
llvm-svn: 86857
2009-11-11 19:04:24 +00:00
Dan Gohman
4631d78a3b Set isBarrier = 1 on return instructions, as they are control barriers.
llvm-svn: 86851
2009-11-11 18:11:07 +00:00
Dan Gohman
3045fc7514 Use a tab in INT3's asm string, for consistency.
llvm-svn: 86850
2009-11-11 18:07:16 +00:00
Chris Lattner
0dd2fe1e1e another const prop failure.
llvm-svn: 86848
2009-11-11 17:54:02 +00:00
Chris Lattner
20da198cb6 add a note
llvm-svn: 86847
2009-11-11 17:51:27 +00:00
Jim Grosbach
d7aab5323b The TBB and TBH instructions for Thumb2 are really handy for jump tables, but
can only branch forward. To best take advantage of them, we'd like to adjust
the basic blocks around a bit when reasonable. This patch puts basics in place
to do that, with a super-simple algorithm for backwards jump table targets that
creates a new branch after the jump table which branches backwards. Real
heuristics for reordering blocks or other modifications rather than inserting
branches will follow.

llvm-svn: 86791
2009-11-11 02:47:19 +00:00
Daniel Dunbar
9789af1797 llvm-gcc/clang don't (won't?) need this hack.
llvm-svn: 86769
2009-11-11 00:28:38 +00:00
Chris Lattner
bc9996444e add a note
llvm-svn: 86756
2009-11-10 23:47:45 +00:00
Chris Lattner
67aac80393 I did this a week or two ago
llvm-svn: 86754
2009-11-10 23:40:49 +00:00