1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

50344 Commits

Author SHA1 Message Date
Craig Topper
c498c5c0e6 Add X86 LZCNT instruction. Including instruction selection support.
llvm-svn: 141651
2011-10-11 06:44:02 +00:00
Cameron Zwarich
a34d748f83 Remove a lot of the fancy scalar replacement code for dealing with llvm-gcc's
lowering of NEON code. It provides little-to-no benefit now and only introduces
additional complexity.

llvm-svn: 141646
2011-10-11 06:10:30 +00:00
Craig Topper
7ae42fbd7e Fix disassembling of popcntw. Also remove some code that says it accounts for 64BIT_REXW_XD not existing, but it does exist.
llvm-svn: 141642
2011-10-11 04:34:23 +00:00
Nick Lewycky
509687695f Also create a shndx even if there are no symbols. This lets us test
.symtab_shndx reading and writing together, and finally we have a testcase for
r141440.

llvm-svn: 141641
2011-10-11 03:54:50 +00:00
Nick Lewycky
7cea83d5a5 Reapply r141605 with fixes for appropriate handling of reserved section numbers
in st_shndx fields.

llvm-svn: 141639
2011-10-11 03:18:58 +00:00
Nick Lewycky
c8160ebc71 Add support for .symtab_shnidx. Unfortunately, doing this required breaking a
layer of abstraction around SymbolRef where you can read its private
SymbolPimpl member.

llvm-svn: 141636
2011-10-11 02:57:48 +00:00
Andrew Trick
23866a5e65 Add experimental -enable-lsr-phielim option.
I'm not sure we will need it in the long run, but the option is
currently useful for checking if the output of LSR is "clean".

llvm-svn: 141634
2011-10-11 02:30:45 +00:00
Andrew Trick
d36852e6b1 Move replaceCongruentIVs into SCEVExapander and bias toward "expanded"
IVs.

Indvars previously chose randomly between congruent IVs. Now it will
bias the decision toward IVs that SCEVExpander likes to create. This
was not done to fix any problem, it's just a welcome side effect of
factoring code.

llvm-svn: 141633
2011-10-11 02:28:51 +00:00
Akira Hatanaka
20808df5a0 Make changes necessary for supporting floating point load and store instructions
that have 64-bit pointers or access the 32 x 64-bit floating pointer register
file. Update functions in MipsInstrInfo.cpp too.

llvm-svn: 141623
2011-10-11 01:12:52 +00:00
Jakob Stoklund Olesen
81dd697279 Move -widen-vmovs to ARMBaseInstrInfo::expandPostRAPseudo().
The VMOVS widening needs to look at the implicit COPY operands.  Trying
to dig out the COPY instruction from an iterator in copyPhysReg() is the
wrong approach.

The expandPostRAPseudo() hook gets to look at COPY instructions before
they are converted to copyPhysReg() calls.

llvm-svn: 141619
2011-10-11 00:59:06 +00:00
Akira Hatanaka
3f89f9bc37 Modify lowering of GlobalAddress so that correct code is emitted when target is
Mips64.

llvm-svn: 141618
2011-10-11 00:55:05 +00:00
Lang Hames
41b4ff724d Fixed natural stack alignment for Linux x86-32. Thanks Eli.
llvm-svn: 141616
2011-10-11 00:51:36 +00:00
Akira Hatanaka
1913a9abc0 Modify MipsDAGToDAGISel::SelectAddr so that it can handle 64-bit pointers too.
llvm-svn: 141615
2011-10-11 00:44:20 +00:00
Nick Lewycky
76c927f5bd Revert r141605 as it broke tests for llvm-nm.
llvm-svn: 141614
2011-10-11 00:38:56 +00:00
Akira Hatanaka
6f90f8d68d Simplify and update functions storeRegToStackSlot and loadRegFromStackSlot.
llvm-svn: 141613
2011-10-11 00:37:28 +00:00
Akira Hatanaka
404fb72f59 Add definitions of 64-bit loads and stores. Add a patterns for unaligned
zextloadi32 for which there is no corresponding pseudo or real instruction. 

llvm-svn: 141608
2011-10-11 00:27:28 +00:00
Tanya Lattner
0ae574fe2b Make it possible to use the linker without destroying the source module. This is so the source module can be linked to multiple other destination modules. For all that used LinkModules() before, they will continue to destroy the source module as before.
This line, and those below, will be ignored--

M    include/llvm/Linker.h
M    tools/bugpoint/Miscompilation.cpp
M    tools/bugpoint/BugDriver.cpp
M    tools/llvm-link/llvm-link.cpp
M    lib/Linker/LinkModules.cpp

llvm-svn: 141606
2011-10-11 00:24:54 +00:00
Nick Lewycky
bf9a3771b7 Add support for reading many-section ELF files.
If you want to tackle adding the testcase, let me know. It's a 4.2MB ELF file
and I'll be happy to mail it to you.

llvm-svn: 141605
2011-10-11 00:15:42 +00:00
Akira Hatanaka
ac95006d45 Change definitions of classes LoadM and StoreM in preparation for adding support
for 64-bit load and store instructions. Add definitions of 64-bit memory operand
and 16-bit immediate operand.

llvm-svn: 141603
2011-10-11 00:11:12 +00:00
Bill Wendling
1a1ee723b0 Simplify check that optional def is there and is CPSR.
llvm-svn: 141602
2011-10-11 00:10:41 +00:00
Lang Hames
be4997db2f Add a natural stack alignment field to TargetData, and prevent InstCombine from
promoting allocas to preferred alignments that exceed the natural
alignment. This avoids some potentially expensive dynamic stack realignments.

The natural stack alignment is set in target data strings via the "S<size>"
option. Size is in bits and must be a multiple of 8. The natural stack alignment
defaults to "unspecified" (represented by a zero value), and the "unspecified"
value does not prevent any alignment promotions. Target maintainers that care
about avoiding promotions should explicitly add the "S<size>" option to their
target data strings.

llvm-svn: 141599
2011-10-10 23:42:08 +00:00
Michael J. Spencer
525906b5d9 Fix warning.
llvm-svn: 141597
2011-10-10 23:36:56 +00:00
Devang Patel
e6091c61c7 Revert r141569 and r141576.
llvm-svn: 141594
2011-10-10 23:18:02 +00:00
Jim Grosbach
ab5dbe090b Simplify operand Kind checks a bit.
llvm-svn: 141592
2011-10-10 23:06:42 +00:00
Bill Wendling
7121342ad5 Reapply r141365 now that PR11107 is fixed.
llvm-svn: 141591
2011-10-10 22:59:55 +00:00
Jim Grosbach
21a08a2b41 Add a name to sub-operand for clarity.
llvm-svn: 141590
2011-10-10 22:55:05 +00:00
Bill Wendling
9cf46b3bd5 If the CPSR is defined by a copy, then we don't want to merge it into an IT
block. E.g., if we have:

  movs  r1, r1
  rsb   r1, 0
  movs  r2, r2
  rsb   r2, 0

we don't want this to be converted to:

  movs  r1, r1
  movs  r2, r2
  itt   mi
  rsb   r1, 0
  rsb   r2, 0

PR11107 & <rdar://problem/10259534>

llvm-svn: 141589
2011-10-10 22:52:53 +00:00
Eli Friedman
7188ba35cb Make sure the X86 backend doesn't explode on 128-bit shuffles in AVX mode. Fixes PR11102.
llvm-svn: 141585
2011-10-10 22:28:47 +00:00
Michael J. Spencer
ebd507f958 Object: add getSectionAlignment.
llvm-svn: 141581
2011-10-10 21:55:43 +00:00
Jakob Stoklund Olesen
0d908f3a85 Give targets a chance to expand even standard pseudos.
Allow targets to expand COPY and other standard pseudo-instructions
before they are expanded with copyPhysReg().

This allows the target to examine the COPY instruction for extra
operands indicating it can be widened to a preferable super-register
copy.  See the ARM -widen-vmovs option.

llvm-svn: 141578
2011-10-10 20:34:28 +00:00
Devang Patel
d6f05a47c1 If loop header is also loop exiting block then it may not be safe to hoist instructions.
llvm-svn: 141576
2011-10-10 20:32:03 +00:00
Benjamin Kramer
60387b6640 X86: Add a subtarget definition for core-avx-i, which is GCC's name for ivy bridge.
llvm-svn: 141571
2011-10-10 19:35:07 +00:00
Nadav Rotem
38187aec17 Fix 10892 - When lowering SIGN_EXTEND_INREG do not lower v2i64 because the
instruction set has no 64-bit SRA support.

llvm-svn: 141570
2011-10-10 19:31:45 +00:00
Devang Patel
c149f390c6 Add dominance check for the instruction being hoisted.
For example, MachineLICM should not hoist a load that is not guaranteed to be executed.
Radar 10254254.

llvm-svn: 141569
2011-10-10 19:09:20 +00:00
Bruno Cardoso Lopes
fa8f5fb2cf The Mips specific function for instruction cache invalidation cannot be
compiled on mips32r1 processors because it uses synci and rdhwr instructions
which are supported only on mips32r2, so I replaced this function with the
call to function cacheflush which works for both mips32r1 and mips32r2.
Patch by Sasa Stankovic

llvm-svn: 141564
2011-10-10 18:41:02 +00:00
Benjamin Kramer
c498279bec X86: Add patterns for the movbe instruction (mov + bswap, only available on atom)
llvm-svn: 141563
2011-10-10 18:34:56 +00:00
Bill Wendling
7cba44defc Revert r141365. It was causing MultiSource/Benchmarks/MiBench/consumer-lame to
hang, and possibly SPEC/CINT2006/464_h264ref.

llvm-svn: 141560
2011-10-10 18:27:30 +00:00
Owen Anderson
40a0b83c92 MCAtom extending methods need to extend the range of the atom as well.
llvm-svn: 141557
2011-10-10 18:09:38 +00:00
Bill Wendling
94258753c7 When getting the number of bits necessary for addressing mode
ARMII::AddrModeT1_s, we need to take into account that if the frame register is
ARM::SP, then the number of bits is 8. If it's not ARM::SP, then the number of
bits is 5.

llvm-svn: 141529
2011-10-10 07:24:23 +00:00
Craig Topper
251bbfb1f7 Put a bunch of calls to ToggleFeature behind proper if statements.
llvm-svn: 141527
2011-10-10 05:34:02 +00:00
Chad Rosier
2fc181986a Fix a regression from r138445. If we're loading from the frame/base pointer
the tADDrSPi instruction can't be used.  Make sure we're updating the opcode
to tADDi3 in all cases.
rdar://10254707

llvm-svn: 141523
2011-10-10 01:03:35 +00:00
Justin Holewinski
ce14c646cd PTX: Print .ptr kernel attributes if PTX version >= 2.2
llvm-svn: 141508
2011-10-09 15:42:02 +00:00
Craig Topper
9b7ab95570 Add Ivy Bridge 16-bit floating point conversion instructions for the X86 disassembler.
llvm-svn: 141505
2011-10-09 07:31:39 +00:00
Jakob Stoklund Olesen
d94788edb9 Prevent potential NOREX bug.
A GR8_NOREX virtual register is created when extrating a sub_8bit_hi
sub-register:

  %vreg2<def> = COPY %vreg1:sub_8bit_hi; GR8_NOREX:%vreg2 %GR64_ABCD:%vreg1
  TEST8ri_NOREX %vreg2, 1, %EFLAGS<imp-def>; GR8_NOREX:%vreg2

If such a live range is ever split, its register class must not be
inflated to GR8.  The sub-register copy can only target GR8_NOREX.

I dont have a test case for this theoretical bug.

llvm-svn: 141500
2011-10-08 20:20:03 +00:00
Jakob Stoklund Olesen
b49557d06d Add TEST8ri_NOREX pseudo to constrain sub_8bit_hi copies.
In 64-bit mode, sub_8bit_hi sub-registers can only be used by NOREX
instructions. The COPY created from the EXTRACT_SUBREG DAG node cannot
target all GR8 registers, only those in GR8_NOREX.

TO enforce this, we ensure that all instructions using the
EXTRACT_SUBREG are GR8_NOREX constrained.

This fixes PR11088.

llvm-svn: 141499
2011-10-08 18:28:28 +00:00
Che-Liang Chiou
c1ba72e15c Revert r141079: tblgen: add preprocessor as a separate mode
llvm-svn: 141492
2011-10-08 12:39:26 +00:00
Nicolas Geoffray
8c7ad22407 Always check if a method or a type exist before trying to create it.
llvm-svn: 141490
2011-10-08 11:56:36 +00:00
NAKAMURA Takumi
2a3eab692a lib/Object: Suppress warnings on gcc-4.3.4 cygwin
llvm-svn: 141485
2011-10-08 11:22:53 +00:00
NAKAMURA Takumi
cc0706b36c lib/DebugInfo/DWARFDebugLine.cpp: De-Unicode-ify.
llvm-svn: 141484
2011-10-08 11:22:47 +00:00
NAKAMURA Takumi
fe47764929 Whitespace
llvm-svn: 141483
2011-10-08 11:22:41 +00:00
Anton Korobeynikov
b0534f0113 Disable ABS optimization for Thumb1 target, we don't have necessary instructions there.
llvm-svn: 141481
2011-10-08 08:38:45 +00:00
Akira Hatanaka
4a78bb776f Simplify definition of FP move instructions.
llvm-svn: 141476
2011-10-08 03:50:18 +00:00
Akira Hatanaka
7780dcc74e Define classes and multiclasses for FP binary instructions.
llvm-svn: 141475
2011-10-08 03:38:41 +00:00
Akira Hatanaka
9595e84a11 Define multiclasses for FP-to-FP instructions.
llvm-svn: 141474
2011-10-08 03:29:22 +00:00
Akira Hatanaka
e39c39db4a Define classes for FP unary instructions and multiclasses for FP-to-fixed point
conversion instructions. 

llvm-svn: 141473
2011-10-08 03:19:38 +00:00
Akira Hatanaka
38d2ddcfac Add patterns for unaligned load and store instructions and enable the
instruction selector to generate them.

llvm-svn: 141471
2011-10-08 02:24:10 +00:00
Andrew Trick
430029d79a Add an extra safety check in front of the optimization in r141442.
llvm-svn: 141470
2011-10-08 02:16:39 +00:00
Bill Wendling
a2a555b0fc Use the code that lowers the arguments and spills any values which are alive
across unwind edges. This is for the back-end which expects such things.

The code is from the original SjLj EH pass.

llvm-svn: 141463
2011-10-08 00:56:47 +00:00
Michael J. Spencer
edcc61ba22 Object: Add support for opening stdin.
llvm-svn: 141449
2011-10-08 00:17:58 +00:00
Michael J. Spencer
1acd078990 Object: constize Archive.
llvm-svn: 141448
2011-10-08 00:17:45 +00:00
Jim Grosbach
94980a23e6 ARM NEON assembly parsing and encoding for VDUP(scalar).
llvm-svn: 141446
2011-10-07 23:56:00 +00:00
Andrew Trick
75743b069e LSR should only reuse phis that match its formula.
Fixes rdar://problem/5064068

llvm-svn: 141442
2011-10-07 23:46:21 +00:00
Eli Friedman
433785c651 Fix APInt::operator*= so that it computes the correct result for large integers where there is unsigned overflow. Fix APFloat::toString so that it doesn't depend on the incorrect behavior in common cases (and computes the correct result in some rare cases). Fixes PR11086.
llvm-svn: 141441
2011-10-07 23:40:49 +00:00
Nick Lewycky
8b0cf65af7 Don't emit the symbol table entry for the .symtab_shndx section either.
llvm-svn: 141440
2011-10-07 23:29:53 +00:00
Nick Lewycky
95b57a67cb Remove extraneous curlies. No functionality change.
llvm-svn: 141439
2011-10-07 23:28:32 +00:00
Jim Grosbach
cb48e1fe60 ARM prefix asmparser operand kind enums for readability.
llvm-svn: 141438
2011-10-07 23:24:09 +00:00
Bill Wendling
a95511a253 Take all of the invoke basic blocks and make the dispatch basic block their new
successor. Remove the old landing pad from their successor list, because it's
now the successor of the dispatch block. Now that the landing pad blocks are no
longer the destination of invokes, we can mark them as normal basic blocks
instead of landing pads.

This more closely resembles what the CFG is actually doing.

llvm-svn: 141436
2011-10-07 23:18:02 +00:00
Bill Wendling
1f7c16c63f Take the code that was emitted for the llvm.eh.dispatch.setup intrinsic and emit
it with the new SjLj emitter stuff. This way there's no need to emit that
kind-of-hacky intrinsic.

llvm-svn: 141419
2011-10-07 22:08:37 +00:00
Bill Wendling
0f5b533c48 Thread the chain through the eh.sjlj.setjmp intrinsic, like it's documented to
do. This will be useful later on with the new SJLJ stuff.

llvm-svn: 141416
2011-10-07 21:25:38 +00:00
Nick Lewycky
fe793806e9 Don't emit a shstrtabindex in the reserved range. Spotted by inspection and
patch by Cary Coutant!

llvm-svn: 141413
2011-10-07 20:58:24 +00:00
Nick Lewycky
112a7ae899 Clarify/fix typo. No functionality change.
llvm-svn: 141412
2011-10-07 20:56:23 +00:00
Jakob Stoklund Olesen
78d177b5ce Constrain both operands on MOVZX32_NOREXrr8.
This instruction is explicitly encoded without an REX prefix, so both
operands but be *_NOREX.

Also add an assertion to copyPhysReg() that fires when the MOV8rr_NOREX
constraints are not satisfied.

This fixes a miscompilation in 20040709-2 in the gcc test suite.

llvm-svn: 141410
2011-10-07 20:15:54 +00:00
Michael J. Spencer
3cc26e4c5e Fix GCC again.
llvm-svn: 141389
2011-10-07 19:46:12 +00:00
Michael J. Spencer
34d76cf95b Change relocation API to be per section. This time without breaking GCC.
llvm-svn: 141385
2011-10-07 19:25:32 +00:00
Jim Grosbach
d3c2b772ee Improve ARM assembly parser diagnostic for unexpected tokens.
Consider:
  mov r8, r11 fred

Previously, we issued the not very informative:
x.s:6:1: error: unexpected token in argument list

^

Now we generate:
x.s:5:14: error: unexpected token in argument list
  mov r8, r11 fred
              ^

llvm-svn: 141380
2011-10-07 18:27:04 +00:00
Bill Wendling
ecbddb2b9e Revert 141376 and 141377 due to breaking the build.
--- Reverse-merging r141377 into '.':
U    tools/llvm-objdump/MachODump.cpp
--- Reverse-merging r141376 into '.':
U    include/llvm/Object/COFF.h
U    include/llvm/Object/ObjectFile.h
U    include/llvm-c/Object.h
U    tools/llvm-objdump/llvm-objdump.cpp
U    lib/Object/MachOObjectFile.cpp
U    lib/Object/COFFObjectFile.cpp
U    lib/Object/Object.cpp
U    lib/Object/ELFObjectFile.cpp

llvm-svn: 141379
2011-10-07 18:25:37 +00:00
David Greene
ae3329d597 Remove Multidefs
Multidefs are a bit unwieldy and incomplete.  Remove them in favor of
another mechanism, probably for loops.

Revert "Make Test More Thorough"
Revert "Fix a typo."
Revert "Vim Support for Multidefs"
Revert "Emacs Support for Multidefs"
Revert "Document Multidefs"
Revert "Add a Multidef Test"
Revert "Update Test for Multidefs"
Revert "Process Multidefs"
Revert "Parser Multidef Support"
Revert "Lexer Support for Multidefs"
Revert "Add Multidef Data Structures"

llvm-svn: 141378
2011-10-07 18:25:05 +00:00
Michael J. Spencer
14925a859b Change relocation API to be per section.
llvm-svn: 141376
2011-10-07 18:15:25 +00:00
Evan Cheng
99b25c827c High bits of movmskp{s|d} and pmovmskb are known zero. rdar://10247336
llvm-svn: 141371
2011-10-07 17:21:44 +00:00
Bob Wilson
b55a64ae72 Reenable tail calls for iOS 5.0 and later.
llvm-svn: 141370
2011-10-07 17:17:49 +00:00
Bob Wilson
d8856e17fe Reenable use of divmod compiler_rt functions for iOS 5.0 and later.
llvm-svn: 141368
2011-10-07 16:59:21 +00:00
Matt Beaumont-Gay
92f76e7901 Move default to top of switch
llvm-svn: 141366
2011-10-07 16:27:01 +00:00
Anton Korobeynikov
0944a4c5cc Peephole optimization for ABS on ARM.
Patch by Ana Pazos!

llvm-svn: 141365
2011-10-07 16:15:08 +00:00
Duncan Sands
559ef2f491 Teach GVN to also propagate switch cases. For example, in this code
switch (n) {
    case 27:
      do_something(x);
    ...
  }
the call do_something(x) will be replaced with do_something(27).  In
gcc-as-one-big-file this results in the removal of about 500 lines of
bitcode (about 0.02%), so has about 1/10 of the effect of propagating
branch conditions.

llvm-svn: 141360
2011-10-07 08:29:06 +00:00
Craig Topper
761bf0e7d3 Add X86 disassembler support for RDFSBASE, RDGSBASE, WRFSBASE, and WRGSBASE.
llvm-svn: 141358
2011-10-07 07:02:24 +00:00
Andrew Trick
276ecf218a PostRA scheduler fix. Clear stale loop dependencies.
Fixes <rdar://problem/10235725>

llvm-svn: 141357
2011-10-07 06:33:09 +00:00
Andrew Trick
7eeb88cd98 whitespace
llvm-svn: 141356
2011-10-07 06:27:02 +00:00
Craig Topper
71e09ffe7b Add X86 disassembler support for XSAVE, XRSTOR, and XSAVEOPT.
llvm-svn: 141354
2011-10-07 05:53:50 +00:00
Craig Topper
f083691b6d Revert part of r141274. Only need to change encoding for xchg %eax, %eax in 64-bit mode. This is because in 64-bit mode xchg %eax, %eax implies zeroing the upper 32-bits of RAX which makes it not a NOP. In 32-bit mode using NOP encoding is fine.
llvm-svn: 141353
2011-10-07 05:35:38 +00:00
Bill Wendling
5492d7a175 Use the correct vreg here.
llvm-svn: 141342
2011-10-06 23:41:14 +00:00
Bill Wendling
e34c65724b Generate the dispatch code for a 'thumb' function. This is very similar to the
others. They take the call site value. Determine if it's a proper value. And
then jumps to the correct call site via a jump table.

llvm-svn: 141341
2011-10-06 23:37:36 +00:00
Owen Anderson
dc57f29896 Fix the check for nested IT instructions in the disassembler. We need to perform the check before adding the Thumb predicate, which pops on entry off the ITBlock queue.
llvm-svn: 141339
2011-10-06 23:33:11 +00:00
Eli Friedman
4d63ca106a Remove the old atomic instrinsics. autoupgrade functionality is included with this patch.
llvm-svn: 141333
2011-10-06 23:20:49 +00:00
Bill Wendling
82b6f24ee4 Generate the dispatch table for ARM mode.
llvm-svn: 141327
2011-10-06 22:53:00 +00:00
Bill Wendling
3c68e1d212 Refactor some of the code that sets up the entry block for SjLj EH. No functionality change.
llvm-svn: 141323
2011-10-06 22:18:16 +00:00
Bill Wendling
c8c252a859 Use a thumb ORR instead of thumb2 ORR when in thumb-only mode. (Picky! Picky!)
Place the immediate to OR into a register so that it works.

llvm-svn: 141319
2011-10-06 21:51:21 +00:00
Bill Wendling
e79ca82af3 * Set the low bit of the return address when we are in thumb mode.
* Some code cleanup.

llvm-svn: 141317
2011-10-06 21:29:56 +00:00
David Greene
711c41bd3d Fix List-of-List Processing
Fix VarListElementInit::resolveListElementReference to return a
partially resolved VarListElementInint in the case where full
resolution is not possible.  This allows TableGen to make forward
progress resolving certain complex list expressions.

llvm-svn: 141315
2011-10-06 21:20:46 +00:00
Matt Beaumont-Gay
13865f3e94 Fix -asserts build
llvm-svn: 141313
2011-10-06 20:59:09 +00:00
Justin Holewinski
19679dac62 PTX: Implement signed division
llvm-svn: 141306
2011-10-06 20:00:33 +00:00