Commit Graph

15297 Commits

Author SHA1 Message Date
Jim Grosbach
469bbdb597 Add basic support to code-gen the ARM/Thumb2 bit-field insert (BFI) instruction
and a combine pattern to use it for setting a bit-field to a constant
value. More to come for non-constant stores.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108570 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 23:05:05 +00:00
Jakob Stoklund Olesen
78e6e00922 Remove the isMoveInstr() hook.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108567 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 22:35:46 +00:00
Jakob Stoklund Olesen
2aaa98da76 Avoid isMoveInstr when printing XCore pseudo-moves.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108566 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 22:35:37 +00:00
Jakob Stoklund Olesen
84d499a698 Use MI.isCopy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108565 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 22:35:34 +00:00
Jakob Stoklund Olesen
c66756ba16 Use a small local function for a single remaining late isMoveInstr call in
Thumb2ITBlockPass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108564 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 22:35:32 +00:00
Bill Wendling
7431beaba2 Rename DBG_LABEL PROLOG_LABEL, because it's only used during prolog emission and
thus is a much more meaningful name.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108563 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 22:20:36 +00:00
Jakob Stoklund Olesen
b47bb13331 Keep valgrind quiet.
The isLive() method can read uninitialized memory, but it still gives correct
results.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108561 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 22:00:33 +00:00
Jakob Stoklund Olesen
a90c3f600d Emit COPY instead of FMR/FMSD instructions for floating point conversion on
PowerPC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108555 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 21:03:52 +00:00
Eli Friedman
32bb4dfd19 Add missing attributes to cpp backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108547 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 18:47:20 +00:00
Dale Johannesen
323200d905 Accept registers with P modifier. PR 5314.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108545 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 18:35:46 +00:00
Jakob Stoklund Olesen
7a79fcb55b Teach PPCInstrInfo::storeRegToStackSlot and loadRegFromStackSlot to add memory
operands.

Hopefully this fixes the llvm-gcc-powerpc-darwin9 buildbot. It really shouldn't
since missing memoperands should not affect correctness.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108540 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 18:22:00 +00:00
Jakob Stoklund Olesen
468a2a44e2 Remove the X86::FP_REG_KILL pseudo-instruction and the X86FloatingPointRegKill
pass that inserted it.

It is no longer necessary to limit the live ranges of FP registers to a single
basic block.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108536 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 17:41:44 +00:00
Jakob Stoklund Olesen
e098e7a96d Search for a free FP register instead of just assuming FP7 is not in use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108535 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 17:41:40 +00:00
Jakob Stoklund Olesen
e928ec9480 Allow x87 FP registers to be alive globally in a function.
FP_REG_KILL instructions are still inserted, but can be disabled by passing
-live-x87 to llc. The X87FPRegKillInserterPass is going to be removed shortly.

CFG edges are partioned into bundles where the x87 stack must be allocated
identically. Code is insertad at the end of each basic block that shuffles the
live FP registers to match the outgoing bundles expectations.

This fix is in preparation for some upcoming register allocator improvements
that may extend the live range of registers beyond a basic block, similar to
LICM. It also provides a nice runtime speedup if you are building with
-mfpmath=387.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108529 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 16:38:12 +00:00
Evan Cheng
60108e96bb Split -enable-finite-only-fp-math to two options:
-enable-no-nans-fp-math and -enable-no-infs-fp-math. All of the current codegen fp math optimizations only care whether the fp arithmetics arguments and results can never be NaN.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108465 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-15 22:07:12 +00:00
Chris Lattner
d1c58cf7bb fix the encoding of MMX_MOVFR642Qrr, it starts with 0xF2 not 0xF3,
this fixes rdar://8192860.  Unfortunately it can only be triggered
with llc because llvm-mc matches another (correctly encoded) version
of this, so no testcase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108454 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-15 20:13:34 +00:00
Eli Friedman
4baa8ebc93 Random note about bswap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108396 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-15 02:20:38 +00:00
Jakob Stoklund Olesen
6881898eb5 Last COPY conversion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108387 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-14 23:58:21 +00:00
Bob Wilson
273ff31e13 Remove restriction on NEON alignment values. Some of the NEON ld/st
instructions use different values (e.g., 2-byte or 4-byte alignment).
Also fix ARMInstPrinter to print these alignments as bits instead of bytes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108386 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-14 23:54:43 +00:00
Jakob Stoklund Olesen
b5378ea12e Use TargetOpcode::COPY instead of X86-native register copy instructions when
lowering atomics. This will allow those copies to still be coalesced after
TII::isMoveInstr is removed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108385 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-14 23:50:27 +00:00
Chris Lattner
41af1cdd1c fix indentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108368 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-14 23:04:59 +00:00
Benjamin Kramer
38e59891ee Don't pass StringRef by reference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108366 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-14 22:38:02 +00:00
Chris Lattner
9fe2c67045 Merge lib/Target/X86/X86COFF.h into include/llvm/Support/COFF.h,
patch by Michael Spencer!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108342 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-14 18:14:33 +00:00
Jim Grosbach
502e0aa628 Improve 64-subtraction of immediates when parts of the immediate can fit
in the literal field of an instruction. E.g.,
long long foo(long long a) {
  return a - 734439407618LL;
}

rdar://7038284



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108339 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-14 17:45:16 +00:00
Bob Wilson
fed76ffa56 Add missing address register update to t2LDM_RET instruction.
Patch by Brian Lucas. PR7636.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108332 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-14 16:02:13 +00:00
Eli Friedman
54cc0e12da A couple potential optimizations inspired by comment 4 in PR6773.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108328 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-14 06:58:26 +00:00
Evan Cheng
dedd974e7e Fix for PR7193 was overly conservative. The only case where sibcall callee
address cannot be allocated a register is in 32-bit mode where the first
three arguments are marked inreg. In that case EAX, EDX, and ECX will be
used for argument passing.

This fixes PR7610.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108327 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-14 06:44:01 +00:00
Bob Wilson
7e3f0d2690 Add support for NEON VMVN immediate instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108324 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-14 06:31:50 +00:00
Bob Wilson
046afdb50b The bits in the cmode field of 32-bit VMOV immediate instructions all depend
of the value of the immediate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108323 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-14 06:30:44 +00:00
Chris Lattner
b09a97e565 fix a bug found by a warning I added to clang this morning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108309 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-14 01:57:17 +00:00
Bob Wilson
9e82bf12a0 Add an ARM-specific DAG combining to avoid redundant VDUPLANE nodes.
Radar 7373643.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108303 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-14 01:22:12 +00:00
Dan Gohman
a10b8494a5 Don't propagate debug locations to instructions for materializing
constants, since they may not be emited near the other instructions
which get the same line, and this confuses debug info.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108302 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-14 01:07:44 +00:00
Bruno Cardoso Lopes
7dbf7d8b1c Add AVX 256-bit compare instructions and a bunch of testcases
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108286 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-13 22:06:38 +00:00
Bob Wilson
cba270d042 Use a target-specific VMOVIMM DAG node instead of BUILD_VECTOR to represent
NEON VMOV-immediate instructions.  This simplifies some things.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108275 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-13 21:16:48 +00:00
Bruno Cardoso Lopes
87a85c7ef0 AVX 256-bit conversion instructions
Add the x86 VEX_L form to handle special cases where VEX_L must be set.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108274 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-13 21:07:28 +00:00
Kevin Enderby
52a18aedae Added a check that pusha cannot be encoded in 64-bit mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108265 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-13 20:05:41 +00:00
Evan Cheng
218977b53e Extend the r107852 optimization which turns some fp compare to code sequence using only i32 operations. It now optimize some f64 compares when fp compare is exceptionally slow (e.g. cortex-a8). It also catches comparison against 0.0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108258 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-13 19:27:42 +00:00
Evan Cheng
7a41599962 Add an ARM "feature". Cortex-a8 fp comparison is very slow (> 20 cycles).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108256 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-13 19:21:50 +00:00
Evan Cheng
ea4cdb7ead -enable-unsafe-fp-math should not imply -enable-finite-only-fp-math.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108254 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-13 18:46:14 +00:00
Gabor Greif
63d024fc9a rotate CallInst operands
with this commit the callee moves to the end of
the operand array (from the start) and the call
arguments now start at index 0 (formerly 1)

this ordering is now consistent with InvokeInst

this commit only flips the switch,
functionally it is equivalent to
r101465

I intend to commit several cleanups after a few
days of soak period



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108240 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-13 15:31:36 +00:00
Bob Wilson
6dce00ced4 Move NEON "modified immediate" encode/decode into ARMAddressingModes.h to
avoid replicated code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108227 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-13 04:44:34 +00:00
Chris Lattner
37a746bc85 my work on adding segment registers to LEA missed the
disassembler.  Remove some code from the disassembler to
compensate, unbreaking disassembly of lea's.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108226 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-13 04:23:55 +00:00
Bruno Cardoso Lopes
fd920fa59a Add AVX 256-bit packed logical forms
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108224 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-13 02:38:35 +00:00
Bruno Cardoso Lopes
6991623dd7 Add AVX 256-bit unop arithmetic instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108223 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-13 01:53:31 +00:00
Bruno Cardoso Lopes
4344d85769 Since AVX is a superset of all SSE versions, only use HasAVX for AVX instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108222 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-13 00:38:47 +00:00
David Greene
8f17bc4fbd Move some SIMD fragment code into X86InstrFragmentsSIMD so that the
utility classes can be used from multiple files.  This will aid
transitioning to a new refactored x86 SIMD specification.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108213 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12 23:41:28 +00:00
Bruno Cardoso Lopes
a0d09a85e2 Add AVX 256 binary arithmetic instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108207 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12 23:04:15 +00:00
Bruno Cardoso Lopes
f428fee70d More refactoring of basic SSE arith instructions. Open room for 256-bit instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108204 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12 22:41:32 +00:00
Dan Gohman
cfbf0ed8b0 Apply the SSE dependence idiom for SSE unary operations to
SD instructions too, in addition to SS instructions. And
add a comment about it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108191 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12 20:46:04 +00:00
Bob Wilson
c7a797b82b Remove some code that doesn't appear to do anything. All the ARM call
instructions already have implicit defs of LR.  The comment suggests that
this is intended to fix something like pr6111, but it doesn't really do
that either.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108186 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12 20:22:45 +00:00