Commit Graph

14175 Commits

Author SHA1 Message Date
Benjamin Kramer
018cbd5ddf Use StringRef::substr instead of std::string::substr to avoid using a free'd
string temporary. This should fix PR6590.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98349 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 13:54:59 +00:00
Bill Wendling
53351a175d The same situation that effected ARM effects PPC with regards to placing the
LSDA into the TEXT section. We need to generate non-lazy pointers to it on
Mach-O. However, the object the NLP points to may be local to the translation
unit. If so, then the NLP needs to have the value of that object specified
instead of "0", which the linker interprets as "external".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98325 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 02:00:43 +00:00
Chris Lattner
f789d26f81 make TargetLoweringObjectFile::getExprForDwarfReference
just make unnamed temp symbols instead of having to come
up with its own names.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98324 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 01:56:43 +00:00
Bill Wendling
08d726c912 MC-ize PPC's asm printing of stubs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98300 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 23:39:44 +00:00
Chris Lattner
42263e2e40 fix a fixme in TargetLoweringObjectFile::getExprForDwarfReference
where we used ot create an MCSymbol for ".".  Now emit an assembler
temporary label and reference it instead of "." textually.

rdar://7739457


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98292 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 21:55:20 +00:00
Dan Gohman
a257095ebb Remove getWidenVectorType, which is no longer used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98289 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 21:39:57 +00:00
Johnny Chen
c0b5dce3fa Set the (Format)F filed of t2Int_MemBarrierV7 & t2Int_SyncBarrierV7 to ThumbFrm,
instead of Pseudo, which helps Thumb decoder to recognize them as Thumb instr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98285 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 21:02:50 +00:00
Bill Wendling
c6678b0014 revert r98270.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98281 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 19:50:31 +00:00
Chris Lattner
3192d14076 rename getSymbolForDwarf* to getExprForDwarf* since it returns
an MCExpr and not an MCSymbol.  Change it to take an MCStreamer,
which is currently unused.

No functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98278 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 19:41:58 +00:00
Evan Cheng
55282267e1 Bad bad bug. x86 force indirect tail call address into eax when it's meant to force it into a call preserved register instead. Change it to ecx for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98270 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 18:49:14 +00:00
Richard Osborne
c6bc9a69d4 Remove dead code. (S|U)MUL_LO is now lowered to LMUL or MACC(S|U)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98269 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 18:38:59 +00:00
Richard Osborne
79a73fbeb3 Add dag combine to simplify lmul(x, 0, a, b)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98258 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 16:26:35 +00:00
Richard Osborne
f766ce5580 Switch XCore over to using inline jump table entries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98256 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 14:58:56 +00:00
Eric Christopher
f27805b5c5 Have fast-isel understand llvm.objectsize. Update testcase for slightly
different codegen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98244 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 06:20:22 +00:00
Daniel Dunbar
f82f4490b1 MC: Sketch initial MCAsmLayout class, which encapsulates the current layout of an assembly file. The MCAsmLayout is also available for use by MCExpr::EvaluateAs{Absolute,Relocatable}, to allow target specific hooks and "absolutizing" of symbols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98227 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 02:28:59 +00:00
Daniel Dunbar
23ac7c78e4 MC: Sketch some TargetAsmBackend hooks we are going to need.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98221 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 01:34:21 +00:00
Daniel Dunbar
6c27f5e574 MC: Provide the target triple to AsmBackend constructors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98220 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 01:34:16 +00:00
Bill Wendling
52a50e5d0e When outputing a non-lazy pointer for a stub, we may need to fill in the value
for the NLP because the object it's pointing to may be internal to the file.

This seems counter-intuitive, but bear with me. When we place the LSDA into the
TEXT section, the type info pointers need to be indirect and pc-rel. We
accomplish this by using NLPs. However, sometimes the types are local to the
file. GCC gets around this by not using a NLP in this case, but a "regular"
indirection like this:

GCC_except_tbl:
  .long Lfoo-.

__ZTIA:  @ This is local
  ...

Lfoo:
  .long __ZTIA

LLVM prefers NLPs on Darwin. In fact, it's more optimal for load performance to
use them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98218 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 01:18:13 +00:00
Johnny Chen
ae1757b452 Added Thumb2 LDRD/STRD pre/post variants for disassembly only.
Plus fixed the encoding of t2LDRDpci such that P = 1 and W = 0 (offset mode).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98217 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 01:13:36 +00:00
Bob Wilson
5265a12f53 Fix ARM buildbot breakage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98215 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 00:46:22 +00:00
Chris Lattner
2968943463 add support, testcases, and dox for the new GHC calling
convention.  Patch by David Terei!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98212 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 00:22:57 +00:00
Bob Wilson
4d6113ee06 Lower small memcpys to load/stores on Thumb2.
Radar 7686922.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98210 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 00:20:49 +00:00
Chris Lattner
bcc5cb4061 Work around a bug in the openbsd assembler on i386,
which doesn't support .quad correctly because it is
"really really old".  PR6528.

Yet another reason the mc assembler should take over ;-)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98205 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 00:06:19 +00:00
Bob Wilson
fbacc888ee Fix an obvious typo in an assert.
Patch by Sean Callanan.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98200 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 22:38:45 +00:00
Bill Wendling
cebae36f57 Add a bit along with the MCSymbols stored in the MachineModuleInfo maps that
indicates that an MCSymbol is external or not. (It's true if it's external.)
This will be used to specify the correct information to add to non-lazy
pointers. That will be explained further when this bit is used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98199 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 22:34:10 +00:00
Dale Johannesen
bfdf7f3852 Progress towards shepherding debug info through SelectionDAG.
No functional effect yet.  This is still evolving and should
not be viewed as final.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98195 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 22:13:47 +00:00
Chris Lattner
6663670359 move PR6576 here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98194 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 21:42:42 +00:00
Jim Grosbach
f49be7c96f Make sure the LR gets pushed in functions that use vaargs. This fixes
400.perlbench for the nightly tests.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98183 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 20:01:30 +00:00
Jim Grosbach
004453e85e comment why we use custom epilogue for t1 functions using vaargs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98182 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 19:59:47 +00:00
Johnny Chen
dd0f3cf189 Factored out the disassembly printing of CPS option, MSR mask, and Negative Zero
operands into their own PrintMethod, in order not to pollute the printOperand()
impl with disassembly only Imm modifiers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98172 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 18:59:38 +00:00
Richard Osborne
72926c264a The backend now makes a reasonable job of targeting lmul / macc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98169 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 18:14:47 +00:00
Richard Osborne
850f1cd3c0 Handle MVT::i64 type in DAG combine for ISD::ADD. Fold 64 bit
expression add(add(mul(x,y),a),b) -> lmul(x,y,a,b) if all
operands are zero extended.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98168 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 18:12:27 +00:00
Richard Osborne
ea670df852 Fix checking of intermediates having one use in isADDADDMUL
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98164 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 17:16:29 +00:00
Richard Osborne
886d861355 Extract recognition of patterns such as add(add(mul(x,y),a),b)
into a seperate function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98162 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 17:10:35 +00:00
Richard Osborne
25ab35e8c7 Fix thinko.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98158 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 16:27:11 +00:00
Richard Osborne
2dacd1e987 Fold add(add(mul(x,y),a),b) -> lmul(x,y,a,b) if the intermediate
results are unused elsewhere.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98157 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 16:19:31 +00:00
Richard Osborne
a2cc0613d0 Prefer LMUL to MACCU as LMUL has no tied operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98153 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 13:27:10 +00:00
Richard Osborne
a7e78402b8 Custom lower (S|U)MUL_LOHI -> MACC(S|U)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98152 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 13:20:07 +00:00
Richard Osborne
34f9d88221 Fix indentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98151 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 11:42:05 +00:00
Richard Osborne
ebc64cf780 Lower add (mul a, b), c into MACCU / MACCS nodes which translate
directly to the maccu / maccs instructions. We handle this in
ExpandADDSUB since after type legalisation it is messy to
recognise these operations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98150 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 11:41:08 +00:00
Chris Lattner
09d53fecfc move three lowering hooks from MAI to TLOF and make one of them
semantic instead of syntactic.  This completes MCization of
darwin/x86[-64]!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98145 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 07:20:42 +00:00
Chris Lattner
98cdab53c3 set the temporary bit on MCSymbols correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98124 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 02:25:11 +00:00
Jim Grosbach
7c617b5e53 Clear up the last (famous last words) frame index value reuse issues for Thumb1.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98109 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 00:13:42 +00:00
Daniel Dunbar
f291be3159 MC/X86: Rename alternate spellings of ADD{8,16,32} and mark as "code gen only" so they don't get selected by the asm matcher.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98098 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 22:50:46 +00:00
Daniel Dunbar
1e8ee89c21 MC/X86: Rename alternate spellings of CMP{8,16,32} and mark as "code gen only" so they don't get selected by the asm matcher.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98097 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 22:50:40 +00:00
Jim Grosbach
dff4b4c5a7 Change the Value argument to eliminateFrameIndex to a type-tagged value. This
is preparatory to having PEI's scavenged frame index value reuse logic
properly distinguish types of frame values (e.g., whether the value is
stack-pointer relative or frame-pointer relative).

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98086 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 21:45:49 +00:00
Johnny Chen
a2c618a0f0 MSR (Move to Special Register from ARM core register) requires a mask to specify
what fields of the CPSR or SPSR are affected.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98085 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 21:39:34 +00:00
Dale Johannesen
f7b730425f The address of an indirect call must be in R12 on Darwin.
Make it so.  (This patch is in LowerCall_Darwin, which seems
to be used by SVR4 code as well; since that doesn't belong here,
I haven't worried about this case.)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98077 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 20:15:42 +00:00
Jim Grosbach
4e501545cd scavenged frame index value re-use gets confused when more than one base
register is involved for thumb1. Work around this for the moment by only
re-using SP-relative offsets. This is temporary 'til the code can distinguish
multiple base registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98071 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 19:07:28 +00:00
Bill Wendling
bdc38e5aa2 The ARM EH experiment worked!
Place the LSDA into the TEXT section for ARM platforms. This involves making the
encoding indirect, pcrel, and sdata4 instead of an absolute pointer. The
references to the type infos are then non-lazy pointers. Revision 98019 changed
the encoding of non-lazy pointers to add the symbol to the non-lazy pointer
definition if it's a local symbol (otherwise, it's external and set to '0' so
that the loader can adjust it to the real value). This paved the way for this
change to work on ARM.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98068 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 18:31:07 +00:00
Richard Osborne
ad4f66c76f In cases where the carry / borrow unused converted ladd / lsub
to an add or a sub.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98059 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 16:34:25 +00:00
Richard Osborne
78717cd804 Canonicalize ladd constant to RHS.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98058 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 16:13:57 +00:00
Richard Osborne
7b871b3464 Add DAG combine for ladd / lsub.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98057 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 16:07:47 +00:00
Dan Gohman
81d0c36d22 Don't try to fold V_SET0 and V_SETALLONES to loads in medium and
large code models.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98042 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 03:01:40 +00:00
Bill Wendling
94a1c631db This is part of an LLC-beta test used to test <rdar://problem/6804645>. Please
bear with the awful code. It won't last in its current state beyond tonight.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98040 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 02:46:12 +00:00
Bill Wendling
cf6f28d84a Print blank line and clear stubs vector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98019 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 00:43:34 +00:00
Bill Wendling
becd83e3f4 MC-ize the stub printing in ARM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98018 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 00:40:17 +00:00
Chris Lattner
82f05078b0 don't reset defaults.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98004 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 23:18:21 +00:00
Bob Wilson
f5fd499791 Fix a crash compiling 254.gap for Thumb2. The Thumb2 add/sub with 12-bit
immediate instructions cannot set the condition codes, so they do not have
the extra cc_out operand.  We hit an assertion during tail duplication
because the instruction being duplicated had more operands that expected.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98001 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 22:56:15 +00:00
Kevin Enderby
0e822407b2 Fix the vmxon entry in the X86InstrInfo.td so it has the correct prefix bytes
for the encoding and is not the same as vmptrld.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97992 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 22:17:26 +00:00
Daniel Dunbar
b93c72cda4 X86: Fix encoding for TEST{8,16,32}rr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97982 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 21:10:36 +00:00
Devang Patel
3c91b05d2b Avoid using DIDescriptor.isNull().
This is a first step towards eliminating checks in Descriptor constructors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97975 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 20:52:55 +00:00
Devang Patel
0ef3fa6aab Revert r97947.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97963 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 19:20:38 +00:00
Chris Lattner
dd6fbd1136 disambiguate some types, add a fixme about some
inconsistent intrinsics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97959 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 18:59:49 +00:00
Chris Lattner
3485b51c4d fix some more ambiguous patterns, remove another nontemporalstore
pattern which is broken (source and address swapped).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97958 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 18:57:56 +00:00
Chris Lattner
341b27406d Correct immediate sizes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97957 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 18:55:15 +00:00
Chris Lattner
0273fbbf22 fix a type compatibility bug. imm is i32 in the input
pattern, not i64.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97956 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 18:52:55 +00:00
Chris Lattner
d10a53d5a1 fix a bunch of partially ambiguous patterns on ARM. As an
example, this:

(set DPR:$dst, (fsub (fneg (fmul DPR:$a, DPR:$b)), DPR:$dstin))

is ambiguous because DPR contains both f64 and v2f32.  tblgen
currently accidentally picks f64 because it's first in the 
regclass.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97955 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 18:51:21 +00:00
Chris Lattner
b200f1c28e Fix a bunch of ambiguous patterns which tblgen happens to infer types
for, due to a bug.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97953 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 18:44:04 +00:00
Chris Lattner
e00ed57087 tidy up
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97950 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 18:29:38 +00:00
Devang Patel
d8cc5d5256 Avoid using DIDescriptor.isNull().
This is a first step towards eliminating unncessary constructor checks in light weight DIDescriptor wrappers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97947 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 18:25:48 +00:00
Chris Lattner
9a1ac4c107 remove a non-temporal store pattern which is not tested and
could never have matched because the operand list was backwards.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97933 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 03:18:28 +00:00
Wesley Peck
c2bf2bbe93 Re-committing the failed r97807 commit with changes to eliminate warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97891 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-06 23:23:12 +00:00
Anton Korobeynikov
e765f2b5e3 Describe what's going on with mingw alloca and why do we need separate instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97888 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-06 20:07:32 +00:00
Anton Korobeynikov
ce7bf1c55f Initial bits of ARMv4-only support.
Patch by John Tytgat!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97886 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-06 19:39:36 +00:00
Anton Korobeynikov
043f3c2a0e Lower dynamic stack allocation on mingw32 to separate instruction.
We cannot use a normal call here since it has extra unmodelled side
effects (it changes stack pointer). This should fix PR5292.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97884 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-06 19:32:29 +00:00
Anton Korobeynikov
9aff323a07 Do not use '&' prefix for globals when register base field is non-zero, otherwise msp430-as will silently miscompile the code (TI's assembler report an error though).
This fixes PR6349

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97877 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-06 11:41:12 +00:00
Chris Lattner
eea3f7e4ee clean this up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97870 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-06 07:02:28 +00:00
Chris Lattner
0a7f442314 revert r97807, it introduced build warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97869 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-06 04:32:46 +00:00
Jim Grosbach
e68bd74245 Thumb1 epilogue code generation needs to take into account that callee-saved
registers may be restored via a pop instruction, not just a tRestore.
This fixes nightly test 471.omnetep for Thumb1.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97867 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-06 03:28:39 +00:00
Evan Cheng
10718492c8 Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97818 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-05 19:55:55 +00:00
Chris Lattner
ac834e7a5f fix bss section printing for cell, patch by Kalle Raiskila!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97814 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-05 18:55:36 +00:00
Wesley Peck
c4155d591b Reworking the stack layout that the MicroBlaze backend generates.
The MicroBlaze backend was generating stack layouts that did not
conform correctly to the ABI. This update generates stack layouts
which are closer to what GCC does.

Variable arguments support was added as well but the stack layout
for varargs has not been finalized.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97807 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-05 15:26:02 +00:00
Evan Cheng
4cae133780 Fix an oops in x86 sibcall optimization. If the ByVal callee argument is itself passed as a pointer, then it's obviously not safe to do a tail call.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97797 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-05 08:38:04 +00:00
Evan Cheng
26e19ba9aa Rever 96389 and 96990. They are causing some miscompilation that I do not fully understand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97782 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-05 03:08:23 +00:00
Johnny Chen
fb86d78a45 Trivial comment change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97776 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-05 01:45:46 +00:00
Bill Wendling
18ce64e069 Revert r97766. It's deleting a tag.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97768 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-05 00:33:59 +00:00
Bill Wendling
37b52ee6d9 Micro-optimization:
This code:

float floatingPointComparison(float x, float y) {
    double product = (double)x * y;
    if (product == 0.0)
        return product;
    return product - 1.0;
}

produces this:

_floatingPointComparison:
0000000000000000        cvtss2sd        %xmm1,%xmm1
0000000000000004        cvtss2sd        %xmm0,%xmm0
0000000000000008        mulsd           %xmm1,%xmm0
000000000000000c        pxor            %xmm1,%xmm1
0000000000000010        ucomisd         %xmm1,%xmm0
0000000000000014        jne             0x00000004
0000000000000016        jp              0x00000002
0000000000000018        jmp             0x00000008
000000000000001a        addsd           0x00000006(%rip),%xmm0
0000000000000022        cvtsd2ss        %xmm0,%xmm0
0000000000000026        ret

The "jne/jp/jmp" sequence can be reduced to this instead:

_floatingPointComparison:
0000000000000000        cvtss2sd        %xmm1,%xmm1
0000000000000004        cvtss2sd        %xmm0,%xmm0
0000000000000008        mulsd           %xmm1,%xmm0
000000000000000c        pxor            %xmm1,%xmm1
0000000000000010        ucomisd         %xmm1,%xmm0
0000000000000014        jp              0x00000002
0000000000000016        je              0x00000008
0000000000000018        addsd           0x00000006(%rip),%xmm0
0000000000000020        cvtsd2ss        %xmm0,%xmm0
0000000000000024        ret

for a savings of 2 bytes.

This xform can happen when we recognize that jne and jp jump to the same "true"
MBB, the unconditional jump would jump to the "false" MBB, and the "true" branch
is the fall-through MBB.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97766 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-05 00:24:26 +00:00
Johnny Chen
267124cff2 Drop the ".w" qualifier for t2UXTB16* instructions as there is no 16-bit version
of either sxtb16 or uxtb16, and the unified syntax does not specify ".w".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97760 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 22:24:41 +00:00
Bob Wilson
436e6e7b5c pr6478: The frame pointer spill frame index is only defined when there is a
frame pointer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97755 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 21:42:36 +00:00
Bob Wilson
bbf39b0fd9 pr6480: Don't try producing ld/st-multiple instructions when the address is
an undef value.  This is only going to come up for bugpoint-reduced tests --
correct programs will not access memory at undefined addresses -- so it's not
worth the effort of doing anything more aggressive.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97745 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 21:04:38 +00:00
Jakob Stoklund Olesen
3cfe01072c Fix the remaining MUL8 and DIV8 to define AX instead of AL,AH.
These instructions technically define AL,AH, but a trick in X86ISelDAGToDAG
reads AX in order to avoid reading AH with a REX instruction.

Fix PR6489.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97742 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 20:42:07 +00:00
Dan Gohman
0ef701e6ae Fix recognition of 16-bit bswap for C front-ends which emit the
clobber registers in a different order.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97741 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 19:58:08 +00:00
Chris Lattner
bfcc8e0a66 not committing what you test = bad.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97740 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 19:54:45 +00:00
Chris Lattner
225d4ca8ab make gep matching in fastisel match the base of the gep as a
register if it isn't possible to match the indexes *and* the base.
This fixes some fast isel rejects of load instructions on oggenc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97739 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 19:48:19 +00:00
Johnny Chen
0635fc5c27 Added 32-bit Thumb instructions for Preload Data (PLD, PLDW) and Preload
Instruction (PLI) for disassembly only.

According to A8.6.120 PLI (immediate, literal), for example, different
instructions are generated for "pli [pc, #0]" and "pli [pc, #-0"].  The
disassembler solves it by mapping -0 (negative zero) to -1, -1 to -2, ..., etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97731 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 17:40:44 +00:00
Chris Lattner
97d853451e add a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97709 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 01:43:43 +00:00
John McCall
992e61992c Teach the pic16 target to recognize pic16-*-* triples.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97691 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 00:21:47 +00:00
Johnny Chen
cb721da4c6 Modified the asm string of 16-bit Thumb MUL instruction so that it prints:
MULS <Rdm>, <Rn>, <Rdm>

according to A8.6.105 MUL Encoding T1.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97675 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 23:15:43 +00:00
Andrew Lenharth
aedc3ec1e2 Fix PR6444, note still doesn't compile libgcc2 all the way, but fixes that error. May not fix it in an ABI complient way. It wasn't clear what gcc does
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97660 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 20:15:31 +00:00
Johnny Chen
e54a3ef087 Added 32-bit Thumb instructions LDRT, LDRBT, LDRHT,,LDRSBT, LDRSHT, STRT, STRBT,
and STRHT for disassembly only.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97655 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 18:45:36 +00:00
Chris Lattner
99fe641325 remove nvload and two patterns that use it which are
better done by dag combine.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97633 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 02:14:54 +00:00
Johnny Chen
0f7866e796 Added 32-bit Thumb instructions t2NOP, t2YIELD, t2WFE, t2WFI, t2SEV, and t2DBG
for disassembly only.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97632 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 02:09:43 +00:00
Chris Lattner
f85eff76b2 factor the 'in the default address space' check out to a single
'dsload' pattern.  tblgen doesn't check patterns to see if they're
textually identical.  This allows better factoring.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97630 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 01:52:59 +00:00
Chris Lattner
1840991d54 factor the 'sign extended from 8 bit' patterns better so
that they are not destination type specific.  This allows
tblgen to factor them and the type check is redundant with
what the isel does anyway.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97629 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 01:45:01 +00:00
Evan Cheng
506049f29f - Change MachineInstr::isIdenticalTo to take a new option that determines whether it should skip checking defs or at least virtual register defs. This subsumes part of the TargetInstrInfo::isIdentical functionality.
- Eliminate TargetInstrInfo::isIdentical and replace it with produceSameValue. In the default case, produceSameValue just checks whether two machine instructions are identical (except for virtual register defs). But targets may override it to check for unusual cases (e.g. ARM pic loads from constant pools).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97628 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 01:44:33 +00:00
Evan Cheng
bc9d22c99a Eliminate unused instruction classes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97617 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 00:43:15 +00:00
Johnny Chen
a43398283d Added 32-bit Thumb instructions t2DMB variants, t2DSB variants, and t2ISBsy for
disassembly only.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97614 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 00:16:28 +00:00
Chris Lattner
fb444af5c9 merge two loops over all nodes in the graph into one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97606 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-02 23:12:51 +00:00
Chris Lattner
98d45790ae eliminate PreprocessForRMW now that isel handles it.
We still preprocess calls and fp return stuff.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97598 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-02 22:33:56 +00:00
Chris Lattner
6b7f39c895 remove 300 lines of code that is now dead in the MSP430 backend
now that isel handles chains more aggressively.  This also
allows us to make isLegalToFold non-virtual.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97597 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-02 22:30:08 +00:00
Chris Lattner
d1b7382983 Fix some issues in WalkChainUsers dealing with
CopyToReg/CopyFromReg/INLINEASM.  These are annoying because
they have the same opcode before an after isel.  Fix this by
setting their NodeID to -1 to indicate that they are selected,
just like what automatically happens when selecting things that
end up being machine nodes.

With that done, give IsLegalToFold a new flag that causes it to
ignore chains.  This lets the HandleMergeInputChains routine be
the one place that validates chains after a match is successful,
enabling the new hotness in chain processing.  This smarter
chain processing eliminates the need for "PreprocessRMW" in the
X86 and MSP430 backends and enables MSP to start matching it's
multiple mem operand instructions more aggressively.

I currently #if out the dead code in the X86 backend and MSP 
backend, I'll remove it for real in a follow-on patch.

The testcase changes are:
  test/CodeGen/X86/sse3.ll: we generate better code
  test/CodeGen/X86/store_op_load_fold2.ll: PreprocessRMW was 
      miscompiling this before, we now generate correct code
      Convert it to filecheck while I'm at it.
  test/CodeGen/MSP430/Inst16mm.ll: Add a testcase for mem/mem
      folding to make anton happy. :)




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97596 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-02 22:20:06 +00:00
Johnny Chen
10a77e14a0 Added 32-bit Thumb instruction CLREX (Clear-Exclusive) for disassembly only.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97595 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-02 22:11:06 +00:00
Johnny Chen
b5031ad4c0 Removed the extra S from the multiclass def T2I_adde_sube_s_irs as well as from
the opc string passed in, since it's a given from the class inheritance of T2sI.
The fixed the extra 's' in adcss & sbcss when disassembly printing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97582 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-02 19:38:59 +00:00
Johnny Chen
93042d1dc8 Added 32-bit Thumb instructions: CPS, SDIV, UDIV, SXTB16, SXTAB16, UXTAB16, SEL,
SMMULR, SMMLAR, SMMLSR, TBB, TBH, and 16-bit Thumb instruction CPS for
disassembly only.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97573 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-02 18:14:57 +00:00
Johnny Chen
9d3acaa1a0 AL is an optional mnemonic extension for always, except in IT instructions.
Add printMandatoryPredicateOperand() PrintMethod for IT predicate printing.

Ref: A8.3 Conditional execution

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97571 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-02 17:57:15 +00:00
Johnny Chen
7cfa51ebd8 Change some asm shift opcode strings to lowercase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97567 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-02 17:03:18 +00:00
Xerxes Ranby
901a8b7c6b fix typo add missing (
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97565 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-02 13:42:03 +00:00
Xerxes Ranby
02735c97fd Unbreak llvm-arm-linux buildbot and fix PR5309.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97564 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-02 13:26:18 +00:00
Chris Lattner
7c306da505 Sink InstructionSelect() out of each target into SDISel, and rename it
DoInstructionSelection.  Inline "SelectRoot" into it from DAGISelHeader.
Sink some other stuff out of DAGISelHeader into SDISel.

Eliminate the various 'Indent' stuff from various targets, which dates
to when isel was recursive.

 17 files changed, 114 insertions(+), 430 deletions(-)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97555 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-02 06:34:30 +00:00
Eric Christopher
8d17882efa Only save vector registers if we've defined for the vector registers.
Fixes PR5309.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97554 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-02 06:25:00 +00:00
Bill Wendling
46ada19645 Remove dead parameter passing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97536 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-02 01:55:18 +00:00
Dan Gohman
a9445e11c5 Floating-point add, sub, and mul are now spelled fadd, fsub, and fmul,
respectively.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97531 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-02 01:11:08 +00:00
Chris Lattner
e60f7b4412 remove a little hack I did for the old isel, not needed
now that it is gone.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97516 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 22:51:11 +00:00
Evan Cheng
73736df88b Remove the optimize for code size limitation on r67917. Optimize 64-bit imul by constants into leas + shl regardless if optimizing for code size. The size saving from using imulq isn't worth it. Also, the lea and shl instructions may expose further optimization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97507 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 22:00:11 +00:00
Chris Lattner
31c020a147 remove a terrible hack that disabled assertions from this file because of build time
problems.  rdar://7697850.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97500 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 21:20:46 +00:00
Chris Lattner
4c353e3c34 stop using generated sdnodexforms.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97485 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 19:38:53 +00:00
Johnny Chen
ad4df4c0da Added STRHT for disassembly only and fixed a bug in AI3sthpo class where the W
bit should be set to 0 instead of 1.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97481 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 19:22:00 +00:00
Dan Gohman
ce931c65ee Add explicit keywords.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97460 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 17:56:46 +00:00
Dan Gohman
85e9601862 This is now done.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97450 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 17:43:57 +00:00
Nathan Keynes
1ac1c1ee5d Add JIT support to the TODO list (test commit)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97443 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 10:40:41 +00:00
Mikhail Glushenkov
5d96eb8671 80-col violations/trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97427 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-28 22:54:30 +00:00
Chris Lattner
e0d2753f2b remove redundant instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97374 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-28 07:23:21 +00:00
Dan Gohman
8772f5041c Add a flag to addPassesToEmit* to disable the Verifier pass run
after LSR, so that clients can opt in.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97357 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-28 00:41:59 +00:00
Dan Gohman
874cadaf21 Implement XMM subregs.
Extracting the low element of a vector is now done with EXTRACT_SUBREG,
and the zero-extension performed by load movss is now modeled with
SUBREG_TO_REG, and so on.

Register-to-register movss and movsd are no longer considered copies;
they are two-address instructions which insert a scalar into a vector.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97354 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-28 00:17:42 +00:00
Dan Gohman
bc9d98b52d The mayHaveSideEffects flag is no longer used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97348 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-27 23:47:46 +00:00
Chris Lattner
9fa200d2a2 remove a bogus pattern, which had the same pattern as STDU
but codegen'd differently.  This really wanted to use some
sort of subreg to get the low 4 bytes of the G8RC register
or something.  However, it's invalid and nothing is testing
it, so I'm just zapping the bogosity.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97345 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-27 21:15:32 +00:00
Chris Lattner
4446c3f4d0 fix an incorrect (overly conservative) predicate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97316 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-27 08:18:55 +00:00
Evan Cheng
2c755ba12a Re-apply 97040 with fix. This survives a ppc self-host llvm-gcc bootstrap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97310 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-27 07:36:59 +00:00
Johnny Chen
adc7733a64 Added the follwoing 32-bit Thumb instructions for disassembly only:
o Parallel addition and subtraction, signed/unsigned
o Miscellaneous operations: QADD, QDADD, QSUB, QDSUB
o Unsigned sum of absolute differences [and accumulate]: USAD8, USADA8
o Signed/Unsigned saturate: SSAT, SSAT16, USAT, USAT16
o Signed multiply accumulate long (halfwords): SMLAL<x><y>
o Signed multiply accumulate/subtract [long] (dual): SMLAD[x], SMLALD[X], SMLSD[X], SMLSLD[X]
o Signed dual multiply add/subtract [long]: SMUAD[X], SMUSD[X]


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97276 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 22:04:29 +00:00
Jakob Stoklund Olesen
baafcbb4db Merge PPC instructions FMRS and FMRD into a single FMR instruction.
This is possible because F8RC is a subclass of F4RC. We keep FMRSD around so
fextend has a pattern.

Also allow folding of memory operands on FMRSD.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97275 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 21:53:24 +00:00
Jakob Stoklund Olesen
243296690e Use the right floating point load/store instructions in PPCInstrInfo::foldMemoryOperandImpl().
The PowerPC floating point registers can represent both f32 and f64 via the
two register classes F4RC and F8RC. F8RC is considered a subclass of F4RC to
allow cross-class coalescing. This coalescing only affects whether registers
are spilled as f32 or f64.

Spill slots must be accessed with load/store instructions corresponding to the
class of the spilled register. PPCInstrInfo::foldMemoryOperandImpl was looking
at the instruction opcode which is wrong.

X86 has similar floating point register classes, but doesn't try to fold
memory operands, so there is no problem there.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97262 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 21:09:24 +00:00
Dale Johannesen
45df761652 Move dbg_value generation to target-independent FastISel,
as X86 is currently the only FastISel target.  Per review.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97255 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 20:01:55 +00:00
Sanjiv Gupta
20c51be30c The cloner has nothing to do if any of the main or ISR entrypoints are not
present in the module.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97232 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 18:32:18 +00:00
Sanjiv Gupta
2b0070211e Reapply things reverted back in 97220, with the fixed test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97228 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 17:59:28 +00:00
Dan Gohman
6fe0df2abb movl is a cheaper way to materialize 0 without clobbering EFLAGS than movabsq.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97227 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 16:49:27 +00:00
Richard Osborne
d712783492 Fix XCoreTargetLowering::isLegalAddressingMode() to handle VoidTy.
Previously LoopStrengthReduce would sometimes be unable to find
a legal formula, causing an assertion failure.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97226 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 16:44:51 +00:00
Chandler Carruth
727cf62123 Revert r97211 and r97213 to get the build green again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97220 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 08:43:09 +00:00
Sanjiv Gupta
651d85c2f2 Currently in LLVM, names of libcalls are assigned during TargetLowering
object construction. There is no provision to change them when the 
code for a function generated. 
So we have to change these names while printing assembly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97213 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 07:31:15 +00:00
Sanjiv Gupta
917733eca0 Before converting an operand to mem, check if it is legal to do so.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97211 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 07:27:35 +00:00
Dan Gohman
e13709af60 Delete a bunch of redundant predicates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97201 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 01:14:30 +00:00
Johnny Chen
6341c5a4c4 Added the following 32-bit Thumb instructions for disassembly only: SMC, RFE,
and SRS.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97164 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 20:25:24 +00:00
Johnny Chen
ce6275fd2c Added the 32-bit Thumb instructions (BXJ) for disassembly only.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97163 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 19:05:29 +00:00
Johnny Chen
2333655ed0 Added the 32-bit Thumb instructions (MRS and MSR) for disassembly only.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97159 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 18:46:43 +00:00
Daniel Dunbar
010b1b2a0d Fix TextAlignFillValue in a few places
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97151 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 18:07:10 +00:00
Johnny Chen
d86d269f08 Added the following 16-bit Thumb instructions for disassembly only: YIELD, WFE,
WFI, SEV, SETEND.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97149 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 17:51:03 +00:00
Dan Gohman
aa9d854b33 Revert r97064. Duncan pointed out that bitcasts are defined in
terms of store and load, which means bitcasting between scalar
integer and vector has endian-specific results, which undermines
this whole approach.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97137 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 15:20:39 +00:00
Sanjiv Gupta
e6ba0b5762 Each field of auxiliary debug entry is only 1 byte long.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97108 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 03:54:49 +00:00
Johnny Chen
bd2c623903 Added tNOP for disassembly only.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97105 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 03:28:51 +00:00
Dan Gohman
377fbc073c Truncate from i64 to i32 is "free" on x86-32, because it involves
just discarding one of the registers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97100 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 03:04:36 +00:00
Scott Michel
0d0840108f Revert this patch for the time being. Needs more testing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97099 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 02:32:54 +00:00
Johnny Chen
4c61cdd307 Added tSVC and tTRAP for disassembly only.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97098 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 02:21:11 +00:00
Scott Michel
3ce2b09797 Large stack frame patch for the CellSPU: handle stack frames that exceed 8176
(511*16) bytes register displacement (D-form).

NOTE: This is a potential headache, given the SPU's local core limitations,
allowing the software developer to commit stack overrun suicide unknowingly.
Also, large SPU stack frames will cause code size explosion. But, one presumes
that the software developer knows what they're doing...

Contributed by Kalle.Raiskila@nokia.com, edited slightly before commit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97091 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 01:53:17 +00:00
Jakob Stoklund Olesen
657baec0af Create a stack frame on ARM when
- Function uses all scratch registers AND
- Function does not use any callee saved registers AND
- Stack size is too big to address with immediate offsets.

In this case a register must be scavenged to calculate the address of a stack
object, and the scavenger needs a spare register or emergency spill slot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97071 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 22:43:17 +00:00
Bob Wilson
e742bb53a3 Check for comparisons of +/- zero when optimizing less-than-or-equal and
greater-than-or-equal SELECT_CCs to NEON vmin/vmax instructions.  This is
only allowed when UnsafeFPMath is set or when at least one of the operands
is known to be nonzero.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97065 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 22:15:53 +00:00
Dan Gohman
c382bc3c0f Make getTypeSizeInBits work correctly for array types; it should return
the number of value bits, not the number of bits of allocation for in-memory
storage.

Make getTypeStoreSize and getTypeAllocSize work consistently for arrays and
vectors.

Fix several places in CodeGen which compute offsets into in-memory vectors
to use TargetData information.

This fixes PR1784.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97064 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 22:05:23 +00:00
Wesley Peck
173c5c40f6 Adding function "lookupGCCName" to MBlazeIntrinsicInfo
Adding the function "lookupGCCName" to the MBlazeIntrinsicInfo
class to support the Clang MicroBlaze target.

Additionally, minor fixes which remove some unused PIC code 
(PIC is not supported yet in the MicroBlaze backend) and
removed some unused variables.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97054 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 20:16:27 +00:00
Johnny Chen
d88360495a Added Vector Swap (VSWPd and VSWPq) instructions for disassembly only.
A8.6.405


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97052 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 20:06:07 +00:00
Jakob Stoklund Olesen
9e6396d05e Stay away from str <undef> in ARMLoadStoreOpt. This pass does not understand
<undef> operands, and can cause scavenger failures when it translates
<kill,undef> to <kill>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97046 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 18:57:08 +00:00
Johnny Chen
39b03163a7 Fixed typo of opcodestr, should be "vst1", not "vld1".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97044 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 18:00:40 +00:00
Daniel Dunbar
cfe30effbb Speculatively revert r97011, "Re-apply 96540 and 96556 with fixes.", again in
the hopes of fixing PPC bootstrap.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97040 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 17:05:47 +00:00
Dan Gohman
e832693acb When forming SSE min and max nodes for UGE and ULE comparisons, it's
necessary to swap the operands to handle NaN and negative zero properly.

Also, reintroduce logic for checking for NaN conditions when forming
SSE min and max instructions, fixed to take into consideration NaNs and
negative zeros. This allows forming min and max instructions in more
cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97025 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 06:52:40 +00:00
Chandler Carruth
ff28103b19 Remove an unused variable. Was this intentional?
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97022 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 06:09:03 +00:00
Johnny Chen
f50e83fd03 Added for disassembly VST1 (multiple single elements) which stores elements to
memory from three or four registers and VST2 (multiple two-element structures)
which stores to memory from two double-spaced registers.

A8.6.391 & A8.6.393


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97018 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 02:57:20 +00:00
Jim Grosbach
5f366af2ff handle very large call frames when require SPAdj != 0 for Thumb1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97013 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 02:15:43 +00:00
Jim Grosbach
f9a4b7653d LowerCall() should always do getCopyFromReg() to reference the stack pointer.
Machine instruction selection is much happier when operands are in virtual
registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97012 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 01:43:03 +00:00
Evan Cheng
97e6b8390b Re-apply 96540 and 96556 with fixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97011 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 01:42:31 +00:00
Jakob Stoklund Olesen
c3027f769a DIV8r must define %AX since X86DAGToDAGISel::Select() sometimes uses it
instead of %AL/%AH.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97006 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 00:39:35 +00:00
Evan Cheng
01be611b82 Fix rev 96389 by restricting the xform to mask that's either signbit or max signed value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96990 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 21:51:54 +00:00
Richard Osborne
8acf71baed Don't mark call instruction as a barrier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96983 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 21:08:11 +00:00
Johnny Chen
d7283d9c54 Added for disassembly VLD1 (multiple single elements) which loads memory into
three or four registers and VLD2 (multiple two-element structures) which loads
memory into two double-spaced registers.

A8.6.307 & A8.6.310


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96980 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 20:51:23 +00:00
Nicolas Geoffray
81d97c0495 Use the module's context instead of the global context.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96977 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 19:42:44 +00:00
Chris Lattner
652b7e488d no need to override IsLegalToFold, the base implementation
disables load folding at -O0.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96973 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 19:33:11 +00:00
Wesley Peck
a70f28ce7d Adding the MicroBlaze backend.
The MicroBlaze is a highly configurable 32-bit soft-microprocessor for
use on Xilinx FPGAs. For more information see:
http://www.xilinx.com/tools/microblaze.htm
http://en.wikipedia.org/wiki/MicroBlaze

The current LLVM MicroBlaze backend generates assembly which can be
compiled using the an appropriate binutils assembler.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96969 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 19:15:24 +00:00
Richard Osborne
3abd8d4e03 ECALLF, ECALLT shouldn't be marked as barriers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96964 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 18:29:49 +00:00
Richard Osborne
4ee2aa7eb2 Mark unconditional branches as barriers. Found using -verify-machineinstrs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96960 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 18:13:38 +00:00
Jim Grosbach
cf453ee70a Spelling. s/suppor /support /
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96954 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 17:16:27 +00:00
Richard Osborne
edb8d21622 Remove unused lowering function LowerJumpTable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96943 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 14:17:20 +00:00
Richard Osborne
78700b0c55 Lower BR_JT on the XCore to a jump into a series of jump instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96942 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 13:25:07 +00:00
Chris Lattner
c6c161265e disable two patterns that are using non-sensical result pattern types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96903 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 07:21:15 +00:00
Chris Lattner
4d0f7c9f39 remove a confused pattern that is trying to match an address
then use it as an MMX register (!?).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96901 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 07:16:12 +00:00
Chris Lattner
6d9f86b773 remove a bunch of dead named arguments in input patterns,
though some look dubious afaict, these are all ok.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96899 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 06:54:29 +00:00
Chris Lattner
be5ad7dce2 fix a type mismatch in this pattern, where we were using an i64 imm in a
place where an i32 imm was required, the old isel just got lucky.

This fixes CodeGen/X86/x86-64-and-mask.ll



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96894 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 06:09:57 +00:00
Chris Lattner
a8e761464d reapply my cellspu changes with a fix to not break the old isel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96885 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 05:30:43 +00:00
Dan Gohman
e2c0924f8e Revert 96854, 96852, and 96849, unbreaking test/CodeGen/CellSPU/i64ops.ll.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96871 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 02:33:29 +00:00
Chris Lattner
8f2b4cc071 X86InstrInfoSSE.td declares PINSRW as having type v8i16,
don't alis it in the MMX .td file with a different width,
split into two X86ISD opcodes.  This fixes an x86 testcase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96859 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 02:07:48 +00:00
Johnny Chen
363ac58263 Added versions of VCGE, VCGT, VCLE, and VCLT NEON instructions which compare to
(immediate #0) for disassembly only.

A8.6.283, A8.6.285, A8.6.287, A8.6.290


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96856 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 01:42:58 +00:00
Chris Lattner
674b75617c fix hte last cellspu failure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96854 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 01:37:39 +00:00
Chris Lattner
8843fd39c8 hack around more crimes in instruction selection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96852 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 01:33:17 +00:00
Chris Lattner
27e998984c the cell backend is making all sorts of unsafe and incorrect assumptions
about ownership and update policies.  It isn't clear why it is doing all
this lowering at isel time instead of in legalize.  This fixes fcmp64.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96849 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 01:20:00 +00:00