Commit Graph

12521 Commits

Author SHA1 Message Date
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
Anton Korobeynikov 4ca8d3a6a6 Fix invalid operand updates & implement post-inc memory operands
llvm-svn: 86466
2009-11-08 14:27:38 +00:00
Anton Korobeynikov eb8692cff9 Throw an error when stack realignment stuff fails instead of silent
code miscompilation

llvm-svn: 86463
2009-11-08 12:58:40 +00:00
Chris Lattner 295f266370 Make TargetData::getStringRepresentation spit out native integer types,
this gives llvm-gcc generated modules the right data.

llvm-svn: 86435
2009-11-08 02:32:01 +00:00
Jim Grosbach a15c3b7124 Use aligned load/store instructions for spilling Q registers when we know the stack slot is 128 bit aligned
llvm-svn: 86425
2009-11-08 00:27:19 +00:00
Evan Cheng fe864425cb Refactor code.
llvm-svn: 86423
2009-11-08 00:15:23 +00:00
Nate Begeman 3a313df69b x86 vector shuffle cleanup/fixes:
1. rename the movhp patfrag to movlhps, since thats what it actually matches
2. eliminate the bogus movhps load and store patterns, they were incorrect.  The load transforms are already handled (correctly) by shufps/unpack.
3. revert a recent test change to its correct form.

llvm-svn: 86415
2009-11-07 23:17:15 +00:00
Jim Grosbach 4e9f379554 80-column cleanup of file header comments
llvm-svn: 86408
2009-11-07 22:00:39 +00:00
Jim Grosbach d1d002a6fe Support alignment specifier for NEON vld/vst instructions
llvm-svn: 86404
2009-11-07 21:25:39 +00:00
Nick Lewycky b9397262b7 Improve tail call elimination to handle the switch statement.
llvm-svn: 86403
2009-11-07 21:10:15 +00:00
Evan Cheng 8b5278a466 t2ldrpci_pic can be used for blockaddress as well.
llvm-svn: 86400
2009-11-07 19:40:04 +00:00
Chris Lattner 8714348afd indicate what the native integer types for the target are.
Please verify.

llvm-svn: 86397
2009-11-07 19:07:32 +00:00
Anton Korobeynikov cf84ab5043 First try of the post-inc operands handling... Not fully worked, though :(
llvm-svn: 86386
2009-11-07 17:15:25 +00:00
Anton Korobeynikov d3c8319f48 Add some dummy support for post-incremented loads
llvm-svn: 86385
2009-11-07 17:15:06 +00:00
Anton Korobeynikov f93bb39b03 Add 8 bit libcalls and make use of them for msp430
llvm-svn: 86384
2009-11-07 17:14:39 +00:00
Anton Korobeynikov e61e0b9a74 Add few pseudo-source-values
llvm-svn: 86383
2009-11-07 17:13:57 +00:00
Anton Korobeynikov 2a88785685 Initial support for addrmode handling. Tests by Brian Lucas!
llvm-svn: 86382
2009-11-07 17:13:35 +00:00
Anton Korobeynikov 1bbc8d2a86 Some preliminary variable asmprinting
llvm-svn: 86381
2009-11-07 17:12:58 +00:00
Anton Korobeynikov 3b7c712e9e Use '.L' for global private prefix (as mspgcc)
llvm-svn: 86380
2009-11-07 17:12:38 +00:00
Anton Korobeynikov e04fa15cb3 Drop old asmprinter stuff
llvm-svn: 86379
2009-11-07 17:12:21 +00:00
Anton Korobeynikov 226467d6a6 It turns out that the testcase in question uncovered subreg-handling bug.
Add assert in asmprinter to catch such cases and xfail the tests.
PR is to be filled.

llvm-svn: 86375
2009-11-07 15:20:32 +00:00
Chris Lattner a381effe72 add the ability for TargetData to return information about legal integer
datatypes on a given CPU.  This is intended to allow instcombine and other
transformations to avoid converting big sequences of operations to an
inconvenient width, and will help clean up after SRoA.  See also "Adding 
legal integer sizes to TargetData" on Feb 1, 2009 on llvmdev, and PR3451.

Comments welcome.

llvm-svn: 86370
2009-11-07 09:35:34 +00:00
Chris Lattner 91f9582fe1 more cleanup.
llvm-svn: 86369
2009-11-07 09:23:04 +00:00
Chris Lattner d82510e109 add some missing #includes
llvm-svn: 86367
2009-11-07 09:20:54 +00:00
Chris Lattner f819398067 rewrite TargetData to use StringRef/raw_ostream instead of thrashing std::strings.
llvm-svn: 86366
2009-11-07 09:13:23 +00:00
Jeffrey Yasskin db5f24ce77 Make the need-stub variables accurate and consistent. In the case of
MachineRelocations, "stub" always refers to a far-call stub or a
load-a-faraway-global stub, so this patch adds "Far" to the term. (Other stubs
are used for lazy compilation and dlsym address replacement.) The variable was
also inconsistent between the positive and negative sense, and the positive
sense ("NeedStub") was more demanding than is accurate (since a nearby-enough
function can be called directly even if the platform often requires a stub).
Since the negative sense causes double-negatives, I switched to
"MayNeedFarStub" globally.

llvm-svn: 86363
2009-11-07 08:51:52 +00:00
Eric Christopher bd05185ef1 Fix a couple of shuffle patterns to use movhlps instead
of movhps as the constraint.  Changes optimizations so
update testcases as appropriate as well.

llvm-svn: 86360
2009-11-07 08:45:53 +00:00
Mon P Wang 5321dd8823 Fixed Overload table bug noticed by Jakob
llvm-svn: 86332
2009-11-07 04:07:33 +00:00
Evan Cheng a8e8a7c976 Refactor code. Fix a potential missing check. Teach isIdentical() about tLDRpci_pic.
llvm-svn: 86330
2009-11-07 04:04:34 +00:00
Evan Cheng 7ff831962a - Add TargetInstrInfo::isIdentical(). It's similar to MachineInstr::isIdentical
except it doesn't care if the definitions' virtual registers differ. This is
  used by machine LICM and other MI passes to perform CSE.
- Teach Thumb2InstrInfo::isIdentical() to check two t2LDRpci_pic are identical.
  Since pc relative constantpool entries are always different, this requires it
  it check if the values can actually the same.

llvm-svn: 86328
2009-11-07 03:52:02 +00:00
Ted Kremenek 50dddc8b07 Update CMake file.
llvm-svn: 86325
2009-11-07 03:26:59 +00:00
Kenneth Uildriks 07119737aa Add code to check at SelectionDAGISel::LowerArguments time to see if return values can be lowered to registers. Coming soon, code to perform sret-demotion if return values cannot be lowered to registers
llvm-svn: 86324
2009-11-07 02:11:54 +00:00
Johnny Chen 3467dcb12d My previous patch (r84124) for setting the encoding bits 4 and 7 of DPSoRegFrm
was wrong and too aggressive in the sense that DPSoRegFrm includes both constant
shifts (with Inst{4} = 0) and register controlled shifts (with Inst{4} = 1 and
Inst{7} = 0).  The 'rr' fragment of the multiclass definitions actually means
register/register with no shift, see A8-11.

llvm-svn: 86319
2009-11-07 00:54:36 +00:00
Jim Grosbach 79d70e3e65 80-columns
llvm-svn: 86310
2009-11-07 00:13:30 +00:00
Evan Cheng 207b246650 - Add pseudo instructions tLDRpci_pic and t2LDRpci_pic which does a pc-relative
load of a GV from constantpool and then add pc. It allows the code sequence to
  be rematerializable so it would be hoisted by machine licm.
- Add a late pass to break these pseudo instructions into a number of real
  instructions. Also move the code in Thumb2 IT pass that breaks up t2MOVi32imm
  to this pass. This is done before post regalloc scheduling to allow the
  scheduler to proper schedule these instructions. It also allow them to be
  if-converted and shrunk by later passes.

llvm-svn: 86304
2009-11-06 23:52:48 +00:00
Anton Korobeynikov 9df3acf486 Honour subreg machine operands during asmprinting
llvm-svn: 86303
2009-11-06 23:45:15 +00:00
Bob Wilson d95ccd6c4d Print VMOV (immediate) operands as hexadecimal values. Apple's assembler
will not accept negative values for these.  LLVM's default operand printing
sign extends values, so that valid unsigned values appear as negative
immediates.  Print all VMOV immediate operands as hex values to resolve this.
Radar 7372576.

llvm-svn: 86301
2009-11-06 23:33:28 +00:00
Evan Cheng 408aa56fb5 Remove ARMPCLabelIndex from ARMISelLowering. Use ARMFunctionInfo::createConstPoolEntryUId() instead.
llvm-svn: 86294
2009-11-06 22:24:13 +00:00
Daniel Dunbar ad36e8aceb Pass StringRef by value.
llvm-svn: 86251
2009-11-06 10:58:06 +00:00
Dan Gohman ee8afcc59d Factor out the printing of the leading tab into printInlineAsm.
llvm-svn: 86199
2009-11-06 00:04:54 +00:00
Dan Gohman 006f9353e1 Use SUBREG_TO_REG instead of INSERT_SUBREG to model x86-64's
implicit zero-extend.

llvm-svn: 86196
2009-11-05 23:53:08 +00:00
Dan Gohman b15f4a1cbd Remove uninteresting and confusing debug output.
llvm-svn: 86149
2009-11-05 18:47:09 +00:00
Chris Lattner 06c26d982e add a note from PR5313
llvm-svn: 86146
2009-11-05 18:19:19 +00:00
Mon P Wang 1a58236c2b Reintroduce support for overloading target intrinsics
llvm-svn: 86114
2009-11-05 03:19:08 +00:00
Jim Grosbach 31569240c6 Grammar.
llvm-svn: 86068
2009-11-04 23:20:40 +00:00
Jim Grosbach 5833df9bde Now that the memory leak from McCat/08-main has been fixed (86056), re-enable
aggressive testing of dynamic stack alignment.
Note that this is off by default, and enabled for LLCBETA nightly results.

llvm-svn: 86064
2009-11-04 23:11:07 +00:00
Jim Grosbach 2c7fd8f1db If a function has no stack frame at all, dynamic realignment isn't necessary.
llvm-svn: 86057
2009-11-04 22:41:51 +00:00
Jim Grosbach cc58cc1d56 dynamic stack realignment necessitates scanning the floating point callee-
saved instructions even if no stack adjustment for those saves is needed.

llvm-svn: 86056
2009-11-04 22:41:00 +00:00
Bob Wilson f84f7105f7 Add PowerPC codegen for indirect branches.
llvm-svn: 86050
2009-11-04 21:31:18 +00:00
Jakob Stoklund Olesen c7cfc94bcc Print out an informative comment for KILL instructions.
The KILL pseudo-instruction may survive to the asm printer pass, just like the IMPLICIT_DEF. Print the KILL as a comment instead of just leaving a blank line in the output.

With -asm-verbose=0, a blank line is printed, like IMPLICIT?DEF.

llvm-svn: 86041
2009-11-04 19:24:37 +00:00
Evan Cheng c63943018f The .n suffix must go after the predicate.
llvm-svn: 86019
2009-11-04 07:38:48 +00:00
Evan Cheng 3f1a92468a Use ldr.n to workaround a darwin assembler bug.
llvm-svn: 85980
2009-11-04 00:00:39 +00:00
Evan Cheng b376ce0169 Fix t2Int_eh_sjlj_setjmp. Immediate form of orr is a 32-bit instruction. So it should be 22 bytes instead of 20 bytes long.
llvm-svn: 85965
2009-11-03 23:13:34 +00:00
Evan Cheng 0410bced1c fconsts / fconstd immediate should be proceeded with #.
llvm-svn: 85952
2009-11-03 21:59:33 +00:00
Anton Korobeynikov 76a4774a0d Move subtarget check upper for NEON reg-reg fixup pass.
llvm-svn: 85914
2009-11-03 18:46:11 +00:00
Evan Cheng 31c2f4701b Trim unnecessary include.
llvm-svn: 85878
2009-11-03 07:08:08 +00:00
Bob Wilson 064c5fef11 For Thumb indirect branches, use "mov pc, reg" which does not switch
between ARM/Thumb modes and does not require the low bit of the target
address to be set for Thumb.

llvm-svn: 85874
2009-11-03 06:29:56 +00:00
Evan Cheng 8d681f0471 Fix PR5367. QPR_8 is the super regclass of DPR_8 and SPR_8.
llvm-svn: 85871
2009-11-03 05:52:54 +00:00
Evan Cheng 23c009f125 Clean up copyRegToReg.
llvm-svn: 85870
2009-11-03 05:51:39 +00:00
Evan Cheng 9e9079371c Add QPR_8 as a superreg class of SPR_8 and DPR_8.
llvm-svn: 85869
2009-11-03 05:50:57 +00:00
Ted Kremenek 187cb4f493 Update CMake file.
llvm-svn: 85861
2009-11-03 04:14:12 +00:00
Anton Korobeynikov d195f9e5c3 Turn neon reg-reg moves fixup code into separate pass. This should reduce the compile time.
llvm-svn: 85850
2009-11-03 01:04:26 +00:00
Anton Korobeynikov fbe0256b23 Revert r85049, it is causing PR5367
llvm-svn: 85847
2009-11-03 00:24:48 +00:00
Bob Wilson b389f2a04d Revert previous change to a comment. The BlockAddresses go in the
constant pool so they don't get wrapped separately.

llvm-svn: 85844
2009-11-03 00:02:05 +00:00
Bob Wilson 1c66e8a6b7 Put BlockAddresses into ARM constant pools.
llvm-svn: 85824
2009-11-02 20:59:23 +00:00
Kevin Enderby d9dfc2e752 Fix ARMAsmParser::ParseMemoryOffsetReg() where the parameter OffsetRegNum should
have been passed as a reference.

llvm-svn: 85823
2009-11-02 20:14:39 +00:00
David Goodwin 5ac6f244fd Fix schedule model for BFC.
llvm-svn: 85809
2009-11-02 17:28:36 +00:00
Bob Wilson 4c00a524eb Hyphenate some comments.
llvm-svn: 85808
2009-11-02 17:10:37 +00:00
Bob Wilson 433ab09ca3 Add support for BlockAddress values in ARM constant pools.
llvm-svn: 85806
2009-11-02 16:59:06 +00:00
Bob Wilson e90a4aa703 Prune unnecessary include.
llvm-svn: 85805
2009-11-02 16:58:31 +00:00
Evan Cheng 115cfc07d5 These are done / no longer care.
llvm-svn: 85798
2009-11-02 07:58:25 +00:00
Evan Cheng f6f1b37f9f Add an entry.
llvm-svn: 85797
2009-11-02 07:51:19 +00:00
Evan Cheng 1708b06c0e Unbreak ARMBaseRegisterInfo::copyRegToReg.
llvm-svn: 85787
2009-11-02 04:44:55 +00:00
Anton Korobeynikov 4d23754b14 Handle splats of undefs properly. This includes the testcase for PR5364 as well.
llvm-svn: 85767
2009-11-02 00:12:06 +00:00
Anton Korobeynikov 0f38d989bd Do not infer the target type for COPY_TO_REGCLASS from dest regclass, this won't work if it can contain several types. Require explicit result type for the node for now. This fixes PR5364.
PS: It seems that blackfin usage of copy_to_regclass is completely bogus!
llvm-svn: 85766
2009-11-02 00:11:39 +00:00
Anton Korobeynikov 8cce1eb6aa 64-bit FP loads & stores operate on both NEON and VFP pipelines.
llvm-svn: 85765
2009-11-02 00:11:06 +00:00
Anton Korobeynikov 14635da94b Use NEON reg-reg moves, where profitable. This reduces "domain-cross" stalls, when we used to mix vfp and neon code (the former were used for reg-reg moves)
llvm-svn: 85764
2009-11-02 00:10:38 +00:00
Evan Cheng 1a4492be97 Fix a couple more places where we are creating ld / st instructions without memoperands.
llvm-svn: 85746
2009-11-01 22:04:35 +00:00
Evan Cheng 43219997b6 Make use of imm12 version of Thumb2 ldr / str instructions more aggressively.
llvm-svn: 85743
2009-11-01 21:12:51 +00:00
Chris Lattner 50ba5c3dc2 improve x86 codegen support for blockaddress. We now compile
the testcase into:

_test1:                                                     ## @test1
## BB#0:                                                    ## %entry
	leaq	L_test1_bb6(%rip), %rax
	jmpq	*%rax
L_test1_bb:                                                 ## Address Taken
LBB1_1:                                                     ## %bb
	movb	$1, %al
	ret
L_test1_bb6:                                                ## Address Taken
LBB1_2:                                                     ## %bb6
	movb	$2, %al
	ret

Note, it is very very strange that BlockAddressSDNode doesn't carry 
around TargetFlags.  Dan, please fix this.

llvm-svn: 85703
2009-11-01 03:25:03 +00:00
Evan Cheng 6f29ad9170 Use cbz and cbnz instructions.
llvm-svn: 85698
2009-10-31 23:46:45 +00:00
Jim Grosbach 5cba8de2c8 vml[as].f32 cause stalls in following advanced SIMD instructions. Avoid using
them for scalar floating point operations for now.

llvm-svn: 85697
2009-10-31 22:57:36 +00:00
Jim Grosbach 8fe6fd702d Expand 64-bit logical shift right inline
llvm-svn: 85687
2009-10-31 21:42:19 +00:00
Jim Grosbach 624fcb286e Expand 64-bit arithmetic shift right inline
llvm-svn: 85685
2009-10-31 21:00:56 +00:00
Jim Grosbach 5d994048dd Expand 64 bit left shift inline rather than using the libcall. For now, this
is unconditional. Making it still use the libcall when optimizing for size
would be a good adjustment.

llvm-svn: 85675
2009-10-31 19:38:01 +00:00
Evan Cheng cdbb70c065 It's safe to remat t2LDRpci; Add PseudoSourceValue to load / store's to enable more machine licm. More changes coming.
llvm-svn: 85643
2009-10-31 03:39:36 +00:00
Kevin Enderby 8be42bd09f Updates to the ARM target assembler for llvm-mc per review comments from
Daniel Dunbar.
- Reordered the fields in the ARMOperand Mem struct to make the struct smaller.
Making bool's into 1 bit fields and put the MCExpr* fields adjacent to each
other.
- Fixed a number of places in ARMAsmParser.cpp so they have doxygen comments.
- Change the name of ARMAsmParser::ParseRegister() to MaybeParseRegister and
added the bool ParseWriteBack parameter.
- Changed ARMAsmParser::ParseMemory() to call MaybeParseRegister().
- Added ARMAsmParser::ParseMemoryOffsetReg to factor out parsing the offset of a
memory operand.  And use it for both parsing both preindexed and post indexing
addressing forms in ARMAsmParser::ParseMemory.
- Changed the first argument to ParseShift() to a reference.
- Changed ParseShift() to check for Rrx first and return to reduce nesting.

llvm-svn: 85632
2009-10-30 22:55:57 +00:00
Bob Wilson c7415bf536 Add a note about Robert Muth's alternate jump table implementation.
llvm-svn: 85624
2009-10-30 22:22:46 +00:00
Dan Gohman 49fa51d936 Fix MachineLICM to use the correct virtual register class when
unfolding loads for hoisting.  getOpcodeAfterMemoryUnfold returns the
opcode of the original operation without the load, not the load
itself, MachineLICM needs to know the operand index in order to get
the correct register class. Extend getOpcodeAfterMemoryUnfold to
return this information.

llvm-svn: 85622
2009-10-30 22:18:41 +00:00
Bob Wilson 6b00f4b7a8 Fix a comment.
llvm-svn: 85610
2009-10-30 20:13:25 +00:00
Rafael Espindola ab7c709f43 This fixes functions like
void f (int a1, int a2, int a3, int a4, int a5,...)

In ARMTargetLowering::LowerFormalArguments if the function has 4 or
more regular arguments we used to set VarArgsFrameIndex using an
offset of 0, which is only correct if the function has exactly 4
regular arguments.

llvm-svn: 85590
2009-10-30 14:33:14 +00:00
Bob Wilson 1cf0b03064 Add ARM codegen for indirect branches.
clang/test/CodeGen/indirect-goto.c runs! (unoptimized)

llvm-svn: 85577
2009-10-30 05:45:42 +00:00
Dan Gohman f7c4299312 Initial x86 support for BlockAddresses.
llvm-svn: 85557
2009-10-30 01:28:02 +00:00
Jim Grosbach 8578068302 Dial back the realignment a bit.
llvm-svn: 85546
2009-10-30 00:08:40 +00:00
Dan Gohman 453d64c9f5 Rename usesCustomDAGSchedInserter to usesCustomInserter, and update a
bunch of associated comments, because it doesn't have anything to do
with DAGs or scheduling. This is another step in decoupling MachineInstr
emitting from scheduling.

llvm-svn: 85517
2009-10-29 18:10:34 +00:00
Jim Grosbach b352d76480 To get more thorough testing from llc-beta nightly runs, do dynamic stack
realignment regardless of whether it's strictly necessary.

llvm-svn: 85476
2009-10-29 02:41:21 +00:00
Bob Wilson 97b9312663 Revert r85346 change to control tail merging by CodeGenOpt::Level.
I'm going to redo this using the OptimizeForSize function attribute.

llvm-svn: 85426
2009-10-28 20:46:46 +00:00
Bob Wilson 73789b848d Add a Thumb BRIND pattern. Change the ARM BRIND assembly to separate the
opcode and operand with a tab.  Check for these instructions in the usual
places.

llvm-svn: 85411
2009-10-28 18:26:41 +00:00
Evan Cheng 6203c6868f fconsts and fconstd are obviously re-materializable.
llvm-svn: 85410
2009-10-28 18:19:56 +00:00
Jim Grosbach 294aea709e Cleanup now that frame index scavenging via post-pass is working for ARM and Thumb2.
llvm-svn: 85406
2009-10-28 17:33:28 +00:00
Evan Cheng ec6d7c945d Give ARMISD::EH_SJLJ_LONGJMP and EH_SJLJ_SETJMP names.
llvm-svn: 85381
2009-10-28 06:55:03 +00:00