Commit Graph

13571 Commits

Author SHA1 Message Date
Bruno Cardoso Lopes 178fb40612 - Register v16i16 as valid VR256 register class
- Add more bitcasts for v16i16
- Since 135661 and 135662 already added the splat logic,
just add one more splat test for v16i16

llvm-svn: 135663
2011-07-21 02:24:08 +00:00
Bruno Cardoso Lopes b878caa5e2 Add support for 256-bit versions of VPERMIL instruction. This is a new
instruction introduced in AVX, which can operate on 128 and 256-bit vectors.
It considers a 256-bit vector as two independent 128-bit lanes. It can permute
any 32 or 64 elements inside a lane, and restricts the second lane to
have the same permutation of the first one. With the improved splat support
introduced early today, adding codegen for this instruction enable more
efficient 256-bit code:

Instead of:
  vextractf128  $0, %ymm0, %xmm0
  punpcklbw %xmm0, %xmm0
  punpckhbw %xmm0, %xmm0
  vinsertf128 $0, %xmm0, %ymm0, %ymm1
  vinsertf128 $1, %xmm0, %ymm1, %ymm0
  vextractf128  $1, %ymm0, %xmm1
  shufps  $1, %xmm1, %xmm1
  movss %xmm1, 28(%rsp)
  movss %xmm1, 24(%rsp)
  movss %xmm1, 20(%rsp)
  movss %xmm1, 16(%rsp)
  vextractf128  $0, %ymm0, %xmm0
  shufps  $1, %xmm0, %xmm0
  movss %xmm0, 12(%rsp)
  movss %xmm0, 8(%rsp)
  movss %xmm0, 4(%rsp)
  movss %xmm0, (%rsp)
  vmovaps (%rsp), %ymm0
We get:
  vextractf128  $0, %ymm0, %xmm0
  punpcklbw %xmm0, %xmm0
  punpckhbw %xmm0, %xmm0
  vinsertf128 $0, %xmm0, %ymm0, %ymm1
  vinsertf128 $1, %xmm0, %ymm1, %ymm0
  vpermilps $85, %ymm0, %ymm0

llvm-svn: 135662
2011-07-21 01:55:47 +00:00
Andrew Trick bd243d0dfe LSR, correct fix for rdar://9786536. Silly casting bug.
llvm-svn: 135654
2011-07-21 01:45:54 +00:00
Andrew Trick 858e9f083d LSR must sometimes sign-extend before generating double constants.
rdar://9786536

llvm-svn: 135650
2011-07-21 01:05:01 +00:00
Andrew Trick 8acb434402 LSR crashes on an empty IVUsers list.
rdar://9786536

llvm-svn: 135644
2011-07-21 00:40:04 +00:00
Devang Patel bcd50a10d5 While emitting constant value, look through derived type and use underlying basic type to determine size and signness of the constant value.
llvm-svn: 135627
2011-07-20 21:57:04 +00:00
Eli Friedman 0cdc148ab8 Bring LICM into compliance with the new "Memory Model for Concurrent Operations" in LangRef.
llvm-svn: 135625
2011-07-20 21:37:47 +00:00
Eli Friedman ae60b6b008 Extend the hack for _GLOBAL_OFFSET_TABLE_ slightly; PR10389.
llvm-svn: 135607
2011-07-20 19:36:11 +00:00
Jim Grosbach 2ea9f25f5f Add parsing/encoding tests for ARM ORR instruction.
llvm-svn: 135602
2011-07-20 18:48:53 +00:00
Jim Grosbach a3fcb962eb Consolidate ARM NOP encoding test.
llvm-svn: 135600
2011-07-20 18:39:38 +00:00
Jim Grosbach 614e90a126 ARM parsing and encoding tests for MVN
llvm-svn: 135599
2011-07-20 18:37:08 +00:00
Jim Grosbach 8d11490771 ARM assembly parsing of MUL instruction.
Correctly handle 's' bit and predication suffices. Add parsing and encoding
tests.

llvm-svn: 135596
2011-07-20 18:20:31 +00:00
Eli Friedman 6ed783228d PR10421: Fix a straightforward bug in the widening logic for CONCAT_VECTORS.
llvm-svn: 135595
2011-07-20 18:14:33 +00:00
Evan Cheng 76792992d6 Add MCObjectFileInfo and sink the MCSections initialization code from
TargetLoweringObjectFileImpl down to MCObjectFileInfo.

TargetAsmInfo is done to one last method. It's *almost* gone!

llvm-svn: 135569
2011-07-20 05:58:47 +00:00
Andrew Trick 638b355a16 indvars: Added getInsertPointForUses to find a valid place to truncate the IV.
llvm-svn: 135568
2011-07-20 05:32:06 +00:00
Eric Christopher 60648578ba New pointer rotate test.
llvm-svn: 135562
2011-07-20 03:09:11 +00:00
Andrew Trick f53622e129 indvars test case for r135558.
llvm-svn: 135559
2011-07-20 02:14:37 +00:00
Andrew Trick c5dd3e976a indvars -disable-iv-rewrite fix: derived GEP IVs
llvm-svn: 135558
2011-07-20 02:08:58 +00:00
Akira Hatanaka a4c09bce9b Lower memory barriers to sync instructions.
llvm-svn: 135537
2011-07-19 23:30:50 +00:00
Evan Cheng ccf243d56b Fix an obvious typo that's preventing x86 (32-bit) from using .literal16.
llvm-svn: 135535
2011-07-19 23:14:32 +00:00
Eli Friedman 55d6ccbb79 PR10386: Don't try to split an edge from an indirectbr.
llvm-svn: 135534
2011-07-19 22:59:41 +00:00
Jim Grosbach d25c2cdad7 Tweak ARM assembly parsing and printing of MSR instruction.
The system register spec should be case insensitive. The preferred form for
output with mask values of 4, 8, and 12 references APSR rather than CPSR.
Update and tidy up tests accordingly.

llvm-svn: 135532
2011-07-19 22:45:10 +00:00
Jim Grosbach 97094d8f06 ARM assembly parsing of MRS instruction.
Teach the parser to recognize the APSR and SPSR system register names. Add
and update tests accordingly.

llvm-svn: 135527
2011-07-19 21:59:29 +00:00
Jim Grosbach 7d1e5f11ea ARM assembly parsing for MRC/MRC2/MRRC/MRRC2.
Add range checking to the immediate operands. Update tests accordingly.

llvm-svn: 135521
2011-07-19 20:35:35 +00:00
Akira Hatanaka f3b29992d5 Use the correct opcodes: SLLV/SRLV or AND must be used instead of SLL/SRL or
ANDi, when the instruction does not have any immediate operands.

llvm-svn: 135520
2011-07-19 20:34:00 +00:00
Jim Grosbach b17d9b12a6 Move mr[r]c[2] ARM tests and tidy up a bit.
llvm-svn: 135517
2011-07-19 20:28:56 +00:00
Jim Grosbach 69721dce67 ARM testcases for MOVT.
llvm-svn: 135516
2011-07-19 20:23:25 +00:00
Jim Grosbach 5cc3b4cd9a ARM assembly parsing for MOV (register).
Correct the handling of the 's' suffix when parsing ARM mode. It's only a
truly separate opcode in Thumb. Add test cases to make sure we handle
the s and condition suffices correctly, including diagnostics.

llvm-svn: 135513
2011-07-19 20:10:31 +00:00
Jim Grosbach 7c09e3c3f3 ARM assembly parsing for MOV (immediate).
Add range checking for the immediate operand and handle the "mov" mnemonic
choosing between encodings based on the value of the immediate. Add tests
for fixups, encoding choice and values, and diagnostic for out of range values.

llvm-svn: 135500
2011-07-19 19:13:28 +00:00
Jim Grosbach 20dd6e9fae Whitespace.
llvm-svn: 135499
2011-07-19 19:02:39 +00:00
Akira Hatanaka e450358a21 Remove redundant instructions.
- In EmitAtomicBinaryPartword, mask incr in loopMBB only if atomic.swap is the
  instruction being expanded, instead of masking it in thisMBB. 
- Remove redundant Or in EmitAtomicCmpSwap. 

llvm-svn: 135495
2011-07-19 18:14:26 +00:00
Richard Osborne f1b800998a Add intrinsics for the zext / sext instructions.
llvm-svn: 135476
2011-07-19 13:28:50 +00:00
Richard Osborne 252c43ee88 Add intrinsics for the testct, testwct instructions.
llvm-svn: 135475
2011-07-19 13:00:40 +00:00
Richard Osborne 707f0beae1 Add intrinsics for the peek and endin instructions.
llvm-svn: 135474
2011-07-19 12:50:25 +00:00
Nick Lewycky 56e99c7933 Remove bogus test: for all possible inputs of %X, the 'sub nsw' is guaranteed
to perform a signed wrap. Don't rely on any particular handling of that case.

llvm-svn: 135471
2011-07-19 08:22:57 +00:00
Evan Cheng 2129f59637 Introduce MCCodeGenInfo, which keeps information that can affect codegen
(including compilation, assembly). Move relocation model Reloc::Model from
TargetMachine to MCCodeGenInfo so it's accessible even without TargetMachine.

llvm-svn: 135468
2011-07-19 06:37:02 +00:00
Devang Patel 9ab3cac694 Revert r135423.
llvm-svn: 135454
2011-07-19 00:28:24 +00:00
Eli Friedman 4d5532a085 FileCheck-ize a couple tests.
llvm-svn: 135427
2011-07-18 21:23:42 +00:00
Devang Patel 4dc76f2438 During bottom up fast-isel, instructions emitted to materalize registers are at top of basic block and do not have debug location. This may misguide debugger while entering the basic block and sometimes debugger provides semi useful view of current location to developer by picking up previous known location as current location. Assign a sensible location to the first instruction in a basic block, if it does not have one location derived from source file, so that debugger can provide meaningful user experience to developers in edge cases.
[take 2]

llvm-svn: 135423
2011-07-18 20:55:23 +00:00
Andrew Trick 7da2417c8a indvars: LinearFunctionTestReplace for non-canonical IVs.
For -disable-iv-rewrite, perform LFTR without generating a new
"canonical" induction variable. Instead find the "best" existing
induction variable for use in the loop exit test and compute the final
value of that IV for use in the new loop exit test. In short,
convert to a simple eq/ne exit test as long as it's cheap to do so.

llvm-svn: 135420
2011-07-18 20:32:31 +00:00
Akira Hatanaka 338879a7f4 Do not treat atomic.load.sub differently than other atomic binary intrinsics.
llvm-svn: 135418
2011-07-18 19:58:59 +00:00
Akira Hatanaka 27292638bd Set mayLoad or mayStore flags for SC and LL in order to prevent LICM from
moving them out of the loop. Previously, stores and loads to a stack frame
object were inserted to accomplish this. Remove the code that was needed to do
this. Patch by Sasa Stankovic.

llvm-svn: 135415
2011-07-18 18:52:12 +00:00
Jakob Stoklund Olesen c45d38e14a Fix a crash when building 177.mesa for armv6.
When splitting a live range immediately before an LDR_POST instruction
that redefines the address register, make sure to use the correct value
number in leaveIntvBefore.

We need the value number entering the instruction.

<rdar://problem/9793765>

llvm-svn: 135413
2011-07-18 18:47:13 +00:00
Bruno Cardoso Lopes 4208cace5f Add AVX 128-bit sqrt versions
llvm-svn: 135404
2011-07-18 17:51:40 +00:00
Nick Lewycky d8921f939c Delete empty unused file.
llvm-svn: 135379
2011-07-18 05:54:06 +00:00
Eric Christopher c56b9c75d5 More minor adjustments.
llvm-svn: 135342
2011-07-16 07:28:35 +00:00
Eli Friedman 0318036c4d Make the disassembler able to disassemble a bunch of instructions with names in the TableGen files containing "64" on x86-32. This includes a bunch of x87 instructions, like fld, and a bunch of SSSE3 instructions on MMX registers like pshufb. Part of PR8873.
llvm-svn: 135337
2011-07-16 02:41:28 +00:00
Bruno Cardoso Lopes 4480040191 Add AVX 128-bit patterns for sint_to_fp
llvm-svn: 135332
2011-07-16 00:50:20 +00:00
Eric Christopher f5a8cc7ef8 Finish propagating %asmtmp->%1 change.
llvm-svn: 135330
2011-07-16 00:26:07 +00:00
Chris Lattner 8b4cf5e8a2 fix rdar://9776316 - type remapping needed for inline asm blobs,
fixing some objc llvm-test crashes with LTO.

llvm-svn: 135324
2011-07-15 23:18:40 +00:00