Commit Graph

12521 Commits

Author SHA1 Message Date
Bob Wilson 120f729eca Based on the testcase for pr3120, running on my MacPro with Xeon processors,
it is definitely profitable to tail duplicate indirect branches for x86.
This is likely to be true to various degrees for all modern x86 processors.

llvm-svn: 89865
2009-11-25 17:27:53 +00:00
Bruno Cardoso Lopes 2db07581b7 Support PIC loading of constant pool entries
llvm-svn: 89863
2009-11-25 12:17:58 +00:00
Daniel Dunbar 900f2ce31c Sketch structure for X86 disassembler.
llvm-svn: 89850
2009-11-25 06:53:08 +00:00
Bruno Cardoso Lopes 2c6d498ccc Use endianess dependent offsets for load/store of doubles when
using two swc/lwc instead of sdc/ldc.

llvm-svn: 89826
2009-11-25 01:05:25 +00:00
Dale Johannesen e0eb336588 Fix compiler warnings.
llvm-svn: 89824
2009-11-25 00:58:21 +00:00
Bruno Cardoso Lopes fa2741e0d3 Only include in the callee saved regs the sub registers to avoid
unnecessary save/restore.

llvm-svn: 89823
2009-11-25 00:47:43 +00:00
Bruno Cardoso Lopes dce6f66cf0 Add proper emission of load/store double to stack slots for mips1 targets!
llvm-svn: 89821
2009-11-25 00:36:00 +00:00
Devang Patel d23ea6a33b Revert r89803.
llvm-svn: 89819
2009-11-25 00:31:13 +00:00
Bob Wilson d4d40670e8 Refactor target hook for tail duplication as requested by Chris.
Make tail duplication of indirect branches much more aggressive (for targets
that indicate that it is profitable), based on further experience with
this transformation.  I compiled 3 large applications with and without
this more aggressive tail duplication and measured minimal changes in code
size.  ("size" on Darwin seems to round the text size up to the nearest
page boundary, so I can only say that any code size increase was less than
one 4k page.) Radar 7421267.

llvm-svn: 89814
2009-11-24 23:35:49 +00:00
Dale Johannesen 5ece8f0a20 Do not store R31 into the caller's link area on PPC.
This violates the ABI (that area is "reserved"), and
while it is safe if all code is generated with current
compilers, there is some very old code around that uses
that slot for something else, and breaks if it is stored
into.  Adjust testcases looking for current behavior.
I've verified that the stack frame size is right in all
testcases, whether it changed or not.  7311323.

llvm-svn: 89811
2009-11-24 22:59:02 +00:00
Devang Patel 29c9b709e3 Enable debug info for ppc-darwin.
llvm-svn: 89803
2009-11-24 21:38:54 +00:00
Evan Cheng 184ec26fcd Enable predication of NEON instructions in Thumb2 mode.
llvm-svn: 89748
2009-11-24 08:06:15 +00:00
Dale Johannesen 86dcae106d Make capitalization of names starting "is" more consistent.
No functional change.

llvm-svn: 89724
2009-11-24 01:09:07 +00:00
Evan Cheng ece825dc4f Data type suffix must come after predicate.
llvm-svn: 89723
2009-11-24 01:05:23 +00:00
Anton Korobeynikov 2522908653 Materialize global addresses via movt/movw pair, this is always better
than doing the same via constpool:
1. Load from constpool costs 3 cycles on A9, movt/movw pair - just 2.
2. Load from constpool might stall up to 300 cycles due to cache miss.
3. Movt/movw does not use load/store unit.
4. Less constpool entries => better compiler performance.

This is only enabled on ELF systems, since darwin does not have needed
relocations (yet).

llvm-svn: 89720
2009-11-24 00:44:37 +00:00
Jim Grosbach f890f51666 80 column violations
llvm-svn: 89718
2009-11-24 00:20:27 +00:00
Jeffrey Yasskin f2ad571443 * Move stub allocation inside the JITEmitter, instead of exposing a
way for each TargetJITInfo subclass to allocate its own stubs. This
means stubs aren't as exactly-sized anymore, but it lets us get rid of
TargetJITInfo::emitFunctionStubAtAddr(), which lets ARM and PPC
support the eager JIT, fixing http://llvm.org/PR4816.

* Rename the JITEmitter's stub creation functions to describe the kind
of stub they create. So far, all of them create lazy-compilation
stubs, but they sometimes get used when far-call stubs are needed.
Fixing http://llvm.org/PR5201 will involve fixing this.

llvm-svn: 89715
2009-11-23 23:35:19 +00:00
Dan Gohman de5dea869f Remove ISD::DEBUG_LOC and ISD::DBG_LABEL, which are no longer used.
Note that "hasDotLocAndDotFile"-style debug info was already broken;
people wanting this functionality should implement it in the
AsmPrinter/DwarfWriter code.

llvm-svn: 89711
2009-11-23 23:20:51 +00:00
Jeffrey Yasskin 19b48370fb Allow more than one stub to be being generated at the same time.
It's probably better in the long run to replace the
indirect-GlobalVariable system. That'll be done after a subsequent
patch.

llvm-svn: 89708
2009-11-23 22:49:00 +00:00
Evan Cheng 738a97a1db Massive refactoring of NEON instructions. Separate opcode from data size specifier suffix, move \t up stream to instruction format, and fix more 80 column violations.
This fixes the NEON asm printing so the "predicate" field is printed between the opcode and the data type suffix.

llvm-svn: 89706
2009-11-23 21:57:23 +00:00
Jim Grosbach dbb4140f37 move fconst[sd] to UAL. <rdar://7414913>
llvm-svn: 89700
2009-11-23 21:08:25 +00:00
Johnny Chen b6528d3244 Partially revert r84730 by removing N2VDup from ARMInstrFormats.td and modifying
VDUPLND and VDUPLNQ to derive from N2V instead of N2VDup.  VDUPLND and VDUPLNQ
now expect op19_18 and op17_16 as the first two args.

llvm-svn: 89699
2009-11-23 21:00:43 +00:00
Jim Grosbach 04c0e76772 fold immediate of a + Const into the user as a subtract if it can fit as a negated two-part immediate.
llvm-svn: 89694
2009-11-23 20:35:53 +00:00
Johnny Chen 5ad7416260 Revert r84572 by removing N3VImm from ARMInstrFormats.td now that we can specify
{?,?,?,?} as op11_8 for VEXTd and VEXTq.

llvm-svn: 89693
2009-11-23 20:09:13 +00:00
Johnny Chen e97457afbc Partially revert r89377 by removing NLdStLN class definition from
ARMInstrFormats.td and fixing VLD[234]LN* and VST[234]LN* to derive from NLdSt
instead of NLdStLN.

llvm-svn: 89684
2009-11-23 18:16:16 +00:00
Johnny Chen ebc60ef80c Make it clear that the index bit(s) of Vector Get Lane and Vector Set Lane
should be left unspecified now that Bob Wilson has fixed pr5470.

llvm-svn: 89676
2009-11-23 17:48:17 +00:00
David Goodwin 1f2457f8aa Minor itinerary fixes for FP instructions.
llvm-svn: 89672
2009-11-23 17:34:12 +00:00
Jim Grosbach fd963e11f5 Move default FrameReg val to getFrameIndexReference(). Otherwise, debug info can get bogus values.
llvm-svn: 89618
2009-11-22 20:05:32 +00:00
Jim Grosbach 90e9062e96 Generate more correct debug info for frame indices.
llvm-svn: 89576
2009-11-22 02:32:29 +00:00
Anton Korobeynikov abdf86d2be Minor optimization: when doing eq/ne comparions and RHS is a constant - swap operands, this will allow us to fold imm into comparison.
llvm-svn: 89574
2009-11-22 01:14:08 +00:00
Anton Korobeynikov 3a31644c7a Drop unsupported imm operands
llvm-svn: 89573
2009-11-22 01:13:54 +00:00
Anton Korobeynikov a9c7bb724a Use 2-byte alignment for functions. 4 bytes are clear overkill here.
llvm-svn: 89572
2009-11-22 01:13:39 +00:00
Anton Korobeynikov d099b578e4 Use semicolon as assembler comment string
llvm-svn: 89571
2009-11-22 01:12:49 +00:00
Jim Grosbach e09e95b35c Revert 89562. We're being sneakier than I was giving us credit for, and this
isn't necessary.

llvm-svn: 89568
2009-11-21 23:34:09 +00:00
Jim Grosbach 43fd822249 Darwin requires a frame pointer for all non-leaf functions to support correct
backtraces.

llvm-svn: 89562
2009-11-21 21:40:08 +00:00
Evan Cheng a33fc86be3 Add predicate operand to NEON instructions. Fix lots (but not all) 80 col violations in ARMInstrNEON.td.
llvm-svn: 89542
2009-11-21 06:21:52 +00:00
Devang Patel ed85e12da6 We are not using DBG_STOPPOINT anymore.
llvm-svn: 89536
2009-11-21 02:46:55 +00:00
Viktor Kutuzov 7dcca8f7fc Added two SubtargetFeatures::AddFeatures methods, which accept a comma-separated string or already parsed command line parameters as input, and some code re-factoring to use these new methods.
llvm-svn: 89516
2009-11-21 00:00:02 +00:00
Dan Gohman 312971513f Fix a thinko that caused spurious @GOTOFFs.
llvm-svn: 89509
2009-11-20 23:30:32 +00:00
Dan Gohman e14b347176 Update for new getBlockAddress signature.
llvm-svn: 89507
2009-11-20 23:21:00 +00:00
Dan Gohman 7a6611793f Target-independent support for TargetFlags on BlockAddress operands,
and support for blockaddresses in x86-32 PIC mode.

llvm-svn: 89506
2009-11-20 23:18:13 +00:00
Sean Callanan c1f532e930 Recommitting PALIGNR shift width fixes.
Thanks to Daniel Dunbar for fixing clang intrinsics:
  http://llvm.org/viewvc/llvm-project?view=rev&revision=89499

llvm-svn: 89500
2009-11-20 22:28:42 +00:00
Dale Johannesen 8495a506eb Remove an incorrect overaggressive optimization
(PPC specific).

llvm-svn: 89496
2009-11-20 22:16:40 +00:00
Sean Callanan 19d92728d0 Reverting PALIGNR fix until I figure out how this
broke the Clang testsuite.

llvm-svn: 89495
2009-11-20 22:09:28 +00:00
Sean Callanan fbed130173 Fixed PALIGNR to take 8-bit rotations in all cases.
Also fixed the corresponding testcase, and the PALIGNR
  intrinsic (tested for correctness with llvm-gcc).

llvm-svn: 89491
2009-11-20 21:40:28 +00:00
Evan Cheng bdb43a9d99 Remat VLDRD from constpool. Clean up some instruction property specifications.
llvm-svn: 89478
2009-11-20 19:57:15 +00:00
Jim Grosbach 6c3b71195a The verify() call of CPEIsInRange() isn't right for the assertion check of
constant pool ranges, as CPEIsInRange() makes conservative assumptions about
the potential alignment changes from branch adjustments. The verification,
on the other hand, runs after those branch adjustments are made, so the
effects on alignment are known and already taken into account. The sanity
check in verify should check the range directly instead.

llvm-svn: 89473
2009-11-20 19:37:38 +00:00
Jim Grosbach fc81352e3f Remove verifySizes() since it's not adding much value.
llvm-svn: 89443
2009-11-20 02:32:06 +00:00
Evan Cheng bbd50b0f78 Also CSE non-pic load from constant pools.
llvm-svn: 89440
2009-11-20 02:10:27 +00:00
Evan Cheng 81a2851bcb Fix codegen of conditional move of immediates. We were not making use of the immediate forms of cmov instructions at all.
llvm-svn: 89423
2009-11-20 00:54:03 +00:00
Eric Christopher a6380af658 Update comment to reflect instruction.
llvm-svn: 89414
2009-11-20 00:21:55 +00:00
Jim Grosbach b73918c42d When placing constant islands and adjusting for alignment padding, inline
assembly can confuse things utterly, as it's assumed that instructions in
inline assembly are 4 bytes wide. For Thumb mode, that's often not true,
so the calculations for when alignment padding will be present get thrown off,
ultimately leading to out of range constant pool entry references. Making
more conservative assumptions that padding may be necessary when inline asm
is present avoids this situation.

llvm-svn: 89403
2009-11-19 23:10:28 +00:00
Evan Cheng b6c7704a8d Refactor cmov selection code out to a separate function. No functionality change.
llvm-svn: 89396
2009-11-19 21:45:22 +00:00
Bill Wendling 31c74dbb10 Reverting the EH table patches.
$ svn merge -c -89279 https://llvm.org/svn/llvm-project/llvm/trunk
--- Reverse-merging r89279 into '.':
U    lib/CodeGen/AsmPrinter/DwarfException.cpp
U    lib/Target/TargetLoweringObjectFile.cpp
$ svn merge -c -89270 https://llvm.org/svn/llvm-project/llvm/trunk
--- Reverse-merging r89270 into '.':
G    lib/CodeGen/AsmPrinter/DwarfException.cpp
G    lib/Target/TargetLoweringObjectFile.cpp

llvm-svn: 89379
2009-11-19 19:21:09 +00:00
Johnny Chen b3b8209d77 Added NLdStLN which is similar to NLdSt with the exception that op7_4 is not
fully specified at this level.  Subclasses of NLdStLN can specify selective
bit(s) for Inst{7-4}, as is done for VLD[234]LN* and VST[234]LN* inside
ARMInstrNEON.td.

llvm-svn: 89377
2009-11-19 19:20:17 +00:00
Jim Grosbach 36a5bf82bf fix typo
llvm-svn: 89369
2009-11-19 18:23:19 +00:00
Dan Gohman 91431b008b Fix a typo in a comment.
llvm-svn: 89360
2009-11-19 16:35:11 +00:00
Evan Cheng 82adca8373 80 col violation.
llvm-svn: 89337
2009-11-19 08:16:50 +00:00
Evan Cheng b18525937c More consistent thumb1 asm printing.
llvm-svn: 89328
2009-11-19 06:57:41 +00:00
Evan Cheng 2a6c92fcb6 Shrink ldr / str [sp, imm0-1024] to 16-bit instructions.
llvm-svn: 89326
2009-11-19 06:32:27 +00:00
Evan Cheng 547abae38d Eliminate more * 4 in Thumb1 asm printing for consistency sake.
llvm-svn: 89325
2009-11-19 06:31:26 +00:00
Bruno Cardoso Lopes 4713b282ce - Add sugregister logic to handle f64=(f32,f32).
- Support mips1 like load/store of doubles:

Instead of:
  sdc $f0, X($3)
Generate:
  swc $f0, X($3)
  swc $f1, X+4($3)

llvm-svn: 89322
2009-11-19 06:06:13 +00:00
Bruno Cardoso Lopes 8bd87239d7 Only use small sections for non linux targets!
llvm-svn: 89316
2009-11-19 05:28:18 +00:00
Bill Wendling 4b384b0294 The "ReadOnlyWithRel" enum seems to apply more to what Darwin does with the EH
exception table than DataRel.

llvm-svn: 89279
2009-11-19 00:09:14 +00:00
Richard Osborne 3bd09434a6 Add XCore support for indirectbr / blockaddress.
llvm-svn: 89273
2009-11-18 23:20:42 +00:00
Bill Wendling 07e6e2c6f8 Attempt #2:
Place the EH table in the __TEXT section on MachO. It saves space.

llvm-svn: 89270
2009-11-18 23:18:46 +00:00
Viktor Kutuzov c3e2b6bcf5 Added getDefaultSubtargetFeatures method to SubtargetFeatures class which returns a correct feature string for given triple.
llvm-svn: 89236
2009-11-18 20:20:05 +00:00
David Goodwin 1fd5fdaa7b Add ARMv6 itineraries.
llvm-svn: 89218
2009-11-18 18:39:57 +00:00
Bob Wilson 9dea05d724 Fix a few places that were missed when we converted to unified syntax.
llvm-svn: 89214
2009-11-18 18:10:35 +00:00
Bob Wilson 290e9a47a9 Add a target hook to allow changing the tail duplication limit based on the
contents of the block to be duplicated.  Use this for ARM Cortex A8/9 to
be more aggressive tail duplicating indirect branches, since it makes it
much more likely that they will be predicted in the branch target buffer.
Testcase coming soon.

llvm-svn: 89187
2009-11-18 03:34:27 +00:00
Bill Wendling dfd8daaf61 The llvm-gcc front-end and the pass manager use two separate TargetData objects.
This is probably not confined to *just* these two things.

Anyway, the llvm-gcc front-end may look up the structure layout information for
an abstract type. That information will be stored into a table with the FE's
TD. Instruction combine can come along and also ask for information on that
abstract type, but for a separate TD (the one associated with the pass manager).

After the type is refined, the old structure layout information in the pass
manager's TD file is out of date. If a new type is allocated in the same space
as the old-unrefined type, then the structure type information in the pass
manager's TD file will be wrong, but won't know it.

Fix this by making the TD's structure type information an abstract type user.

llvm-svn: 89176
2009-11-18 01:03:56 +00:00
Jim Grosbach cdde77c6a3 Enable arm jumpt table adjustment.
llvm-svn: 89143
2009-11-17 21:24:11 +00:00
Anton Korobeynikov f24804413d Both Darwin as and GNU as violate ARM docs wrt printing of addrmode6
alignment imm (in the same way). Fix asmprinting for non-darwin platforms.

llvm-svn: 89137
2009-11-17 20:04:59 +00:00
Johnny Chen 14b25eb87b Set Inst{15-12} (Rd/Rt) to 0b1111 (PC) for BR_JTadd, BR_JTr, and BR_JTm to
distinguish between them and the more generic instructions (add, mov, and ldr).

llvm-svn: 89108
2009-11-17 17:17:50 +00:00
Evan Cheng 5392cc9d14 Re-apply 89011. It's not to be blamed.
llvm-svn: 89081
2009-11-17 09:51:18 +00:00
Evan Cheng 05938e819b Revert 89011. Buildbot thinks it might be breaking stuff.
llvm-svn: 89076
2009-11-17 09:20:28 +00:00
Jim Grosbach af1ad30a23 When moving a block for table jumps, make sure the prior block terminator
is analyzable so it can be updated. If it's not, be safe and don't move the
block.

llvm-svn: 89022
2009-11-17 01:21:04 +00:00
Evan Cheng d33400e636 MOV64rm should be marked isReMaterializable.
llvm-svn: 89019
2009-11-17 00:55:55 +00:00
Evan Cheng ce28f6f478 A few more instructions that should be marked re-materializable.
llvm-svn: 89011
2009-11-17 00:23:22 +00:00
Johnny Chen 18183b6d8e 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 10d3604a9e 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 f25ef4ffb0 - 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 56ee15c162 Make the pass class name more explicit.
llvm-svn: 88964
2009-11-16 21:13:22 +00:00
Jim Grosbach 544b15cbc3 make pass name a bit more clear
llvm-svn: 88961
2009-11-16 21:03:58 +00:00
Jim Grosbach 9785e5914f 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 87b0f0d95c clarify comment
llvm-svn: 88933
2009-11-16 18:55:47 +00:00
Jim Grosbach 9c148c2163 back off for a bit. tracking down weirdness
llvm-svn: 88919
2009-11-16 17:17:48 +00:00
Jim Grosbach 47d5e333ff 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 5bf807688e Disable ldc1/sdc1 instructions for mips1 targets.
llvm-svn: 88887
2009-11-16 04:35:29 +00:00
Bruno Cardoso Lopes 537e409c58 - 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 01c1cae34d 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 74ae3e5b0e set the def of the VLD1q64 properly
llvm-svn: 88873
2009-11-15 21:05:07 +00:00
Nick Lewycky ef4ea9a2a9 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 e07594df45 cleanup.
llvm-svn: 88812
2009-11-14 21:33:37 +00:00
Jim Grosbach 43d2108546 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 d5f2745965 Add XCore support for arbitrary-sized aggregate returns.
llvm-svn: 88802
2009-11-14 19:33:35 +00:00
Anton Korobeynikov fd0c7bae2a Temporary disable the error - it seems to be too conservative.
llvm-svn: 88800
2009-11-14 18:01:41 +00:00
Daniel Dunbar 241d01b590 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 d03742a122 revert 88761 as it fails builds.
llvm-svn: 88762
2009-11-14 07:22:25 +00:00
Sanjiv Gupta 8f9c22646b Fix debug info crashes for PIC16.
llvm-svn: 88761
2009-11-14 06:19:49 +00:00
Evan Cheng 6ad7da96fe - 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 66401c90da 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 ff0302489b The instruction pointer %RIP is a reserved register on x86_64.
llvm-svn: 88705
2009-11-13 21:56:01 +00:00
David Greene 659c1a9d78 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 b9fe5d5d02 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 a03b5b44fc 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 5f4eecf961 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 46a524c3e8 Block renumbering
llvm-svn: 87056
2009-11-13 01:19:24 +00:00
Jim Grosbach 969910b3e8 use lower case for readability
llvm-svn: 87054
2009-11-13 01:17:22 +00:00
David Greene 2f4c37425b 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 be851acfb0 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 70fdd57dc1 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 1fbe054450 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 68e4945c03 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 5d57714e6c 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 e129dd311e Use table to separate opcode from operands.
llvm-svn: 86965
2009-11-12 07:16:34 +00:00
Evan Cheng 15b80e4a9f isLegalICmpImmediate should take a signed integer; code clean up.
llvm-svn: 86964
2009-11-12 07:13:11 +00:00
Jim Grosbach 6385ea7c4e 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 626d49f684 A real solution for the first part of PR5445
llvm-svn: 86895
2009-11-11 23:09:33 +00:00
Evan Cheng 3d3c24a82c 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 d576d66d91 Do jump table adjustment before constant island allocation
llvm-svn: 86857
2009-11-11 19:04:24 +00:00
Dan Gohman 9fd22f68f2 Set isBarrier = 1 on return instructions, as they are control barriers.
llvm-svn: 86851
2009-11-11 18:11:07 +00:00
Dan Gohman d2a0f80ede Use a tab in INT3's asm string, for consistency.
llvm-svn: 86850
2009-11-11 18:07:16 +00:00
Chris Lattner 7a09964e81 another const prop failure.
llvm-svn: 86848
2009-11-11 17:54:02 +00:00
Chris Lattner 539bdf0487 add a note
llvm-svn: 86847
2009-11-11 17:51:27 +00:00
Jim Grosbach 8d92ec45c7 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 bc299f0092 llvm-gcc/clang don't (won't?) need this hack.
llvm-svn: 86769
2009-11-11 00:28:38 +00:00
Chris Lattner 0169fd7c62 add a note
llvm-svn: 86756
2009-11-10 23:47:45 +00:00
Chris Lattner 8ff26038ef I did this a week or two ago
llvm-svn: 86754
2009-11-10 23:40:49 +00:00
Dan Gohman de8d418ac3 Don't mark conditional branch instructions as control barriers.
llvm-svn: 86732
2009-11-10 22:16:57 +00:00
Bill Wendling fc9469f311 Modify how the prologue encoded the "move" information for the FDE. GCC
generates a sequence similar to this:

__Z4funci:
LFB2:
        mflr r0
LCFI0:
        stmw r30,-8(r1)
LCFI1:
        stw r0,8(r1)
LCFI2:
        stwu r1,-80(r1)
LCFI3:
        mr r30,r1
LCFI4:

where LCFI3 and LCFI4 are used by the FDE to indicate what the FP, LR, and other
things are. We generated something more like this:

Leh_func_begin1:
        mflr r0
        stw r31, 20(r1)
        stw r0, 8(r1)
Llabel1:
        stwu r1, -80(r1)
Llabel2:
        mr r31, r1

Note that we are missing the "mr" instruction. This patch makes it more like the
GCC output.

llvm-svn: 86729
2009-11-10 22:14:04 +00:00
Evan Cheng e034867587 Change Thumb1 address mode printing, instead of
[r0, #2 * 4]
Now
[r0, #8]

This makes Thumb2 assembly more uniform and frankly the scale doesn't add much.

llvm-svn: 86707
2009-11-10 19:48:13 +00:00
Evan Cheng e6548f4106 Add a comment.
llvm-svn: 86706
2009-11-10 19:44:56 +00:00
Daniel Dunbar b9415c7d9a Add a monstrous hack to improve X86ISelDAGToDAG compile time.
- Force NDEBUG on in any Release build. This drops the compile time to ~100s
   from ~600s, in Release mode.

 - This may just be a temporary workaround, I don't know the true nature of the
   gcc-4.2 compile time performance problem.

llvm-svn: 86695
2009-11-10 18:24:37 +00:00
Bruno Cardoso Lopes 05671ea10a Fix PR5445
llvm-svn: 86651
2009-11-10 02:35:13 +00:00
Jeffrey Yasskin b40d3f76a0 Fix DenseMap iterator constness.
This patch forbids implicit conversion of DenseMap::const_iterator to
DenseMap::iterator which was possible because DenseMapIterator inherited
(publicly) from DenseMapConstIterator. Conversion the other way around is now
allowed as one may expect.

The template DenseMapConstIterator is removed and the template parameter
IsConst which specifies whether the iterator is constant is added to
DenseMapIterator.

Actually IsConst parameter is not necessary since the constness can be
determined from KeyT but this is not relevant to the fix and can be addressed
later.

Patch by Victor Zverovich!

llvm-svn: 86636
2009-11-10 01:02:17 +00:00
David Goodwin 0d412c2528 Fixed to address code review. No functional changes.
llvm-svn: 86634
2009-11-10 00:48:55 +00:00
David Goodwin cf89db135e Allow targets to specify register classes whose member registers should not be renamed to break anti-dependencies.
llvm-svn: 86628
2009-11-10 00:15:47 +00:00
Jim Grosbach 2524b04d0e Now that the default is 'enabled,' a separate command line option for ARM is
not necessary.

llvm-svn: 86621
2009-11-09 23:11:45 +00:00
Jim Grosbach 1218b804fb Enable dynamic stack realignment by default.
llvm-svn: 86604
2009-11-09 22:32:40 +00:00
Jim Grosbach 55d3480769 Set dynamic stack realignment to real values.
llvm-svn: 86602
2009-11-09 22:32:03 +00:00
Bill Wendling 787997f77e Similar to r86588, but for Darwin this time.
llvm-svn: 86592
2009-11-09 21:45:26 +00:00
Bill Wendling 7307bff420 The jump table was being generated before the end label for exception handling
was generated. This caused code like this:

## The asm code for the function
        .section        __TEXT,__const
        .align  2
lJTI11_0:
LJTI11_0:
        .long    LBB11_16
        .long    LBB11_4
        .long    LBB11_5
        .long    LBB11_6
        .long    LBB11_7
        .long    LBB11_8
        .long    LBB11_9
        .long    LBB11_10
        .long    LBB11_11
        .long    LBB11_12
        .long    LBB11_13
        .long    LBB11_14
Leh_func_end11:   ## <---now in the wrong section!

The `Leh_func_end11' would then end up in the wrong section, causing the
resulting EH frame information to be wrong:

__ZL11CheckRightsjPKcbRbRP6NSData.eh:
    .set    Lset500eh,Leh_frame_end11-Leh_frame_begin11
    .long   Lset500eh  ; Length of Frame Information Entry                                                                                                                   
Leh_frame_begin11:
    .long   Leh_frame_begin11-Leh_frame_common
    .long   Leh_func_begin11-.
    .set    Lset501eh,Leh_func_end11-Leh_func_begin11
    .long   Lset501eh                                   ; FDE address range                                                                                                                                   
`Lset501eh' is now something huge instead of the real value.

The X86 back-end generates the jump table after the EH information is
emitted. Do the same here.

llvm-svn: 86588
2009-11-09 21:20:14 +00:00
Jim Grosbach ad95414c26 Work around assembler not recognizing #0.0 form immediate for vmcp
llvm-svn: 86548
2009-11-09 15:27:51 +00:00
Bruno Cardoso Lopes 8dd7c54a42 Fix PR5149.
http://llvm.org/bugs/show_bug.cgi?id=5149

llvm-svn: 86543
2009-11-09 14:27:49 +00:00
Jim Grosbach d7cf55cd0e Use Unified Assembly Syntax for the ARM backend.
llvm-svn: 86494
2009-11-09 00:11:35 +00:00
Anton Korobeynikov 700c4ab3f9 Add and-not (bic) patterns. Based heavily on patch by Brian Lucas!
llvm-svn: 86471
2009-11-08 15:33:12 +00:00
Anton Korobeynikov e92c508764 Move OR patterns upper to all logical stuff. No functionality change.
llvm-svn: 86470
2009-11-08 15:32:44 +00:00
Anton Korobeynikov a404d61c8e Some nice peephole patterns. Based on patch by Brian Lucas!
llvm-svn: 86469
2009-11-08 15:32:28 +00:00
Anton Korobeynikov fd9a893cab Print tab before operand of jcc
llvm-svn: 86468
2009-11-08 15:32:11 +00:00