Commit Graph

5175 Commits

Author SHA1 Message Date
Chris Lattner
54482b472a fix a bug in range information for $42, eliminate an
unneeded argument from ParseExpression.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93536 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 19:39:23 +00:00
Chris Lattner
0a3c5a54a1 add range information for mem X86Operand's, now all
X86Operand's have range info.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93535 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 19:33:43 +00:00
Chris Lattner
b4307b3370 extend MCAsmParser::ParseExpression and ParseParenExpression
to return range information for subexpressions.  Use this to
provide range info for several new X86Operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93534 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 19:28:38 +00:00
Chris Lattner
1f19f0f31d give X86Operand a ctor and start passing SMLoc's into it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93532 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 19:06:59 +00:00
Dale Johannesen
3752d2fe34 Revert 93499. After discussion with Chris we agreed
FrameIndexes should be lowered, but the same way as
everything else (target dependent) rather than in a
special hacked way.  The lowering needs to be done
for eventual purposes of Dwarf generation.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93530 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 18:58:14 +00:00
Chris Lattner
29ef9a21dd add range location info for registers, change
X86Operand::Create* implementations to avoid
copy ctor use.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93528 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 18:51:29 +00:00
Chris Lattner
309264d1e4 clean up the memory management of the operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93526 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 18:44:13 +00:00
Chris Lattner
23075746a1 refactor ParseRegister to avoid using X86Operand as a temporary
datastructure when parsing a mem operand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93521 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 18:27:19 +00:00
Dale Johannesen
bc971c1575 Lower FrameIndex operand of DEBUG_VALUE (specially) and
print it as a comment on X86.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93499 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 01:54:55 +00:00
Chris Lattner
9898671a74 Split the TargetAsmParser "ParseInstruction" interface in half:
the new ParseInstruction method just parses and returns a list of
target operands.  A new MatchInstruction interface is used to
turn the operand list into an MCInst.

This requires new/deleting all the operands, but it also gives 
targets the ability to use polymorphic operands if they want to. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93469 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 22:21:20 +00:00
Chris Lattner
f007e853e2 prune #includes in TargetAsmParser.h
Pass in SMLoc of instr opcode into ParseInstruction.
Make AsmToken be a class, not a struct.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93457 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 21:32:45 +00:00
Chris Lattner
45220a8439 introduce the MCParsedAsmOperand class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93454 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 21:20:55 +00:00
Chris Lattner
5350f78323 this is an SSE-specific issue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93373 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 23:29:11 +00:00
Chris Lattner
689339c50f X86 if conversion + tail merging issues from PR6032.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93372 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 23:28:40 +00:00
Evan Cheng
57d1d936fc For now, avoid issuing extract_subreg to reuse lower 8-bit, it's not safe in 32-bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93307 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 08:01:32 +00:00
Chris Lattner
ee9250bb4f eliminate some uses of Mangler::makeNameProper.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93305 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 07:56:59 +00:00
Chris Lattner
4813035b72 change Mangler::makeNameProper to return its result in a SmallVector
instead of returning it in an std::string.  Based on this change:

1. Change TargetLoweringObjectFileCOFF::getCOFFSection to take a StringRef
2. Change a bunch of targets to call makeNameProper with a smallstring,
   making several of them *much* more efficient.
3. Rewrite Mangler::makeNameProper to not build names and then prepend
   prefixes, not use temporary std::strings, and to avoid other crimes.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93298 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 06:38:18 +00:00
Evan Cheng
7da9ecf967 Add a quick pass to optimize sign / zero extension instructions. For targets where the pre-extension values are available in the subreg of the result of the extension, replace the uses of the pre-extension value with the result + extract_subreg.
For now, this pass is fairly conservative. It only perform the replacement when both the pre- and post- extension values are used in the block. It will miss cases where the post-extension values are live, but not used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93278 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 00:30:23 +00:00
Evan Cheng
3bda20112e Eliminate or_not_add and just use AddedComplexity so isel tries or_is_add patterns first.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93245 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 18:31:19 +00:00
Duncan Sands
796248fdb1 Revert commit 93204, since it causes the assembler to barf
on x86-64 linux with messages like this:
Error: Incorrect register `%r14' used with `l' suffix


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93242 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 17:46:16 +00:00
Duncan Sands
990c4b87e3 Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93235 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 08:30:46 +00:00
Duncan Sands
e2de606e0b Tweak commit 91745, which changed target data for both Mingw and Cygwin,
to not touch Cygwin: the change caused llvm-gcc build failures due to
long double getting the wrong size.  Patch by Aaron Gray.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93234 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 08:21:07 +00:00
Dan Gohman
f1b4d26e67 Reapply the MOV64r0 patch, with a fix: MOV64r0 clobbers EFLAGS.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93229 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 04:42:54 +00:00
Evan Cheng
a5a81d7072 Add TargetInstrInfo::isCoalescableInstr. It returns true if the specified
instruction is copy like where the source and destination registers can
overlap. This is to be used by the coalescable to coalesce the source and
destination registers of instructions like X86::MOVSX64rr32. Apparently
some crazy people believe the coalescer is too simple.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93210 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 00:09:37 +00:00
Evan Cheng
b85071c736 Add manual ISD::OR fastisel selection routines. TableGen is no longer autogen them after 93152 and 93191.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93204 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-11 22:59:27 +00:00
Evan Cheng
199c4240fe Extend r93152 to work on OR r, r. If the source set bits are known not to overlap, then select as an ADD instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93191 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-11 22:03:29 +00:00
Evan Cheng
05920b8146 Revert 93158. It's breaking quite a few x86_64 tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93185 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-11 21:13:41 +00:00
Evan Cheng
ac000fa0ed Do not turn 8-bit OR to ADD since ADD8ri is not 3-addressfiable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93182 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-11 20:18:04 +00:00
Benjamin Kramer
d4f195999a Reimplement getToken and SplitString as "StringRef helper functions"
- getToken is modeled after StringRef::split but it can split on multiple
  separator chars and skips leading seperators.
- SplitString is a StringRef::split variant for more than 2 elements with the
  same behaviour as getToken.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93161 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-11 18:03:24 +00:00
Dan Gohman
e5dacc55ad Use a 32-bit and with implicit zero-extension instead of a 64-bit and if it
has an immediate with at least 32 bits of leading zeros, to avoid needing to
materialize that immediate in a register first.

FileCheckize, tidy, and extend a testcase to cover this case.

This fixes rdar://7527390.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93160 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-11 17:58:34 +00:00
Dan Gohman
71c25b7d7b Re-instate MOV64r0 and MOV16r0, with adjustments to work with the
new AsmPrinter. This is perhaps less elegant than describing them
in terms of MOV32r0 and subreg operations, but it allows the
current register to rematerialize them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93158 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-11 17:37:57 +00:00
Dan Gohman
7e0d64a49c Pattern top-level operators don't need to be restricted to a
single user. The _su forms are intended for non-top-level nodes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93155 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-11 17:21:05 +00:00
Dan Gohman
9e83467baa Reword this comment to reference a more fundamental issue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93154 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-11 17:14:46 +00:00
Evan Cheng
4b0345be30 Select an OR with immediate as an ADD if the input bits are known zero. This allow the instruction to be 3address-fied if needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93152 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-11 17:03:47 +00:00
David Greene
95eb2eeea6 Implement a feature (-vector-unaligned-mem) to allow targets to
ignore alignment requirements for SIMD memory operands.  This
is useful on architectures like the AMD 10h that do not trap on
unaligned references if a status bit is twiddled at startup time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93151 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-11 16:29:42 +00:00
Jeffrey Yasskin
a77169dbeb Fix http://llvm.org/PR5729: x86-64 tail calls were putting their targets into
R11, and then asserting that the target was in R9.  Since R9 isn't reserved for
the target anymore, and is used as an argument, this patch changes the
assertion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93065 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-09 18:56:43 +00:00
Evan Cheng
306b4cafc1 Fix a critical bug in 64-bit atomic operation lowering for 32-bit. The results of the cmpxchg8b instructions are being thrown away when it branches back to the top of the checking loop. This means the loop always compares against the old value and this can result in a dead lock.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93028 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-08 23:41:50 +00:00
Evan Cheng
ad5b52fd5e Fix comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93020 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-08 19:14:57 +00:00
Eric Christopher
968b35ff47 After further thought revert the patch to make fast-isel avoid
putting relocations into the constant pool - this isn't needed
for correctness and in the rare occasion it happens would pull
us out of fast isel for the block.

If fast-isel application startup time ever becomes an issue we
can add better support for these addresses instead of bailing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92995 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-08 08:24:49 +00:00
Evan Cheng
b093bd0565 Fix what looks to me obvious instruction definition bugs.
1. CMPXCHG8B and CMPXCHG16B did not specify implicit physical register defs and uses.
2. LCMPXCHG8B is loading 64 bit memory, not 32 bit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92985 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-08 01:29:19 +00:00
Eric Christopher
d74a7d4e2c Remove extraneous include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92972 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-08 00:05:33 +00:00
Eric Christopher
e6c74c9c2a If the data requires a relocation then don't attempt to
add it to the constant pool for fast-isel. We already
don't add it for the normal case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92934 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 19:45:14 +00:00
Evan Cheng
17751dac3e Fix a minor regression from my dag combiner changes. One more place which needs to look pass truncates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92885 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 00:54:06 +00:00
Evan Cheng
d40d03e1bd Teach dag combine to fold the following transformation more aggressively:
(OP (trunc x), (trunc y)) -> (trunc (OP x, y))

Unfortunately this simple change causes dag combine to infinite looping. The problem is the shrink demanded ops optimization tend to canonicalize expressions in the opposite manner. That is badness. This patch disable those optimizations in dag combine but instead it is done as a late pass in sdisel.

This also exposes some deficiencies in dag combine and x86 setcc / brcond lowering. Teach them to look pass ISD::TRUNCATE in various places.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92849 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-06 19:38:29 +00:00
Benjamin Kramer
8c65f6e71c Move remaining stuff to the isInteger predicate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92771 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 21:05:54 +00:00
Benjamin Kramer
11acaa374c Convert a ton of simple integer type equality tests to the new predicate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92760 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 20:07:06 +00:00
Evan Cheng
54de3ea1ca Code refactoring.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92694 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 06:52:31 +00:00
David Greene
f5c95a6ee2 Change errs() to dbgs().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92654 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 01:29:34 +00:00
David Greene
5b90132332 Change errs() to dbgs().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92653 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 01:29:29 +00:00
David Greene
92f164416b Change errs() to dbgs().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92651 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 01:29:23 +00:00