1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

62073 Commits

Author SHA1 Message Date
Ulrich Weigand
cd7cbdb152 [PowerPC] Clean up VK_PPC_TOC... names
This is another minor cleanup; to bring enum names in line
with the corresponding @modifier names, this renames:

  VK_PPC_TOC -> VK_PPC_TOCBASE
  VK_PPC_TOC_ENTRY -> VK_PPC_TOC16

No code change intended.

llvm-svn: 184491
2013-06-20 22:39:42 +00:00
Kevin Enderby
b71a2e2f2e Update the X86 disassembler to use xacquire and xrelease when appropriate.
This is a bit tricky as the xacquire and xrelease hints use the same bytes,
0xf2 and 0xf3, as the repne and rep prefixes.

Fortunately llvm has different llvm MCInst Opcode enums for rep/xrelease
and repne/xacquire. So to make this work a boolean was added the
InternalInstruction struct as part of the Prefix state which is set with the
added logic in readPrefixes() when decoding an instruction to determine
if these prefix bytes are to be disassembled as xacquire or xrelease.  Then
we let the matcher pick the normal prefix instructionID and we change the
Opcode after that when it is set into the MCInst being created.

rdar://11019859

llvm-svn: 184490
2013-06-20 22:32:18 +00:00
Rafael Espindola
ca881d57f8 Add another fixme.
llvm-svn: 184488
2013-06-20 22:07:53 +00:00
Ulrich Weigand
4de6b60db1 [PowerPC] Minor cleanup in PPCELFObjectWriter::getRelocTypeInner
This just re-sorts the big switch statement in
PPCELFObjectWriter::getRelocTypeInner to follow
the (numerical) order of the reloc types, and
fixes a couple of whitespace issues.

llvm-svn: 184485
2013-06-20 22:04:40 +00:00
Rafael Espindola
9636a2717e Remove last use of PathV1.h from Archive.cpp.
llvm-svn: 184484
2013-06-20 22:02:10 +00:00
Tom Stellard
a1d0e771db R600/SI: Expand sub for v2i32 and v4i32 for SI
Also add a v2i32 test to the existing v4i32 test.

Patch by: Aaron Watry

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Aaron Watry<awatry@gmail.com>
llvm-svn: 184482
2013-06-20 21:55:37 +00:00
Tom Stellard
c419716668 R600/SI: Expand add for v2i32 and v4i32
Also add SI tests to existing file and a v2i32 test for both
R600 and SI.

Patch by: Aaron Watry

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 184481
2013-06-20 21:55:30 +00:00
Tom Stellard
a6ec00250a R600: Expand v2i32 load/store instead of custom lowering
The custom lowering causes llc to crash with a segfault.

Ideally, the custom lowering can be fixed, but this allows
programs which load/store v2i32 to work without crashing.

Patch by: Aaron Watry

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Aaron Watry<awatry@gmail.com>
llvm-svn: 184480
2013-06-20 21:55:23 +00:00
Rafael Espindola
932ff464b9 make getLastModificationTime const. Move it with the other getters.
llvm-svn: 184478
2013-06-20 21:51:49 +00:00
Sean Silva
873dafebc7 [yaml2obj][ELF] Add support for st_value and st_size.
After this patch, the ELF file produced by
`yaml2obj-elf-symbol-basic.yaml`, when linked and executed on x86_64
(under SysV ABI, obviously; I tested on Linux), produces a working
executable that goes into an infinite loop!

llvm-svn: 184469
2013-06-20 20:59:47 +00:00
Sean Silva
b8315826cf [yaml2obj][ELF] Allow symbols to reference sections.
llvm-svn: 184468
2013-06-20 20:59:41 +00:00
Rafael Espindola
695308b067 Add a setLastModificationAndAccessTime to PathV2.
With this we can remove the last use of PathV1 from llvm-ar.cpp.

llvm-svn: 184464
2013-06-20 20:56:14 +00:00
Meador Inge
f58d6431f9 Remove the simplify-libcalls pass (finally)
This commit completely removes what is left of the simplify-libcalls
pass.  All of the functionality has now been migrated to the instcombine
and functionattrs passes.  The following C API functions are now NOPs:

  1. LLVMAddSimplifyLibCallsPass
  2. LLVMPassManagerBuilderSetDisableSimplifyLibCalls

llvm-svn: 184459
2013-06-20 19:48:07 +00:00
Rafael Espindola
ffbd9ee39f Add support for getting the last modification time from a file_status.
Use that in llvm-ar.cpp to replace a use of sys::PathWithStatus.

llvm-svn: 184450
2013-06-20 18:42:04 +00:00
Nadav Rotem
9191086b4b Clang-format the SLP vectorizer. No functionality change.
llvm-svn: 184446
2013-06-20 17:54:36 +00:00
Joey Gouly
a600985f50 This reverts r155000.
The cdp2 instruction should have the same restrictions as cdp on the
co-processor registers.

VFP instructions on v8/AArch32 share the same encoding space as cdp2.

llvm-svn: 184445
2013-06-20 17:42:36 +00:00
Nadav Rotem
83cdea61cd SLPVectorization: Add a basic support for cross-basic block slp vectorization.
We collect gather sequences when we vectorize basic blocks. Gather sequences are excellent
hints for vectorization of other basic blocks.

llvm-svn: 184444
2013-06-20 17:41:45 +00:00
Ulrich Weigand
502b057268 [PowerPC] Remove unused parameter
The isDarwin parameter to the llvm::LowerPPCMachineInstrToMCInst
routine is now no longer needed; remove it.

llvm-svn: 184441
2013-06-20 16:58:14 +00:00
Nadav Rotem
b87c78377e Change the debug type to match the debug type that is used by vecutils.cpp.
This change makes it easier to filter debug messages.

llvm-svn: 184440
2013-06-20 16:38:05 +00:00
Ulrich Weigand
4cd8a01569 [PowerPC] Add missing build dependency
This (hopefully) fixes build failures resulting from r184436;
the PowerPC asm parser now depends on PowerPC target expresssions.

llvm-svn: 184439
2013-06-20 16:38:00 +00:00
Ulrich Weigand
8c70d558d3 [MC] Support @ variants with directional labels
The assembler parser common code supports recognizing symbol variants
using the @ modifer.  On PowerPC, it should also be possible to use
(some of) those modifiers with directional labels, like "1f@l".

This patch adds support for accepting symbol variants on directional
labels as well.

llvm-svn: 184437
2013-06-20 16:24:17 +00:00
Ulrich Weigand
99f0423d50 [PowerPC] Optimize @ha/@l constructs
This patch adds support for having the assembler optimize fixups
to constructs like "symbol@ha" or "symbol@l" if "symbol" can be
resolved at assembler time.

This optimization is already present in the PPCMCExpr.cpp code
for handling PPC_HA16/PPC_LO16 target expressions.  However,
those target expression were used only on Darwin targets.

This patch changes target expression code so that they are
usable also with the GNU assembler (using the @ha / @l syntax
instead of the ha16() / lo16() syntax), and changes the
MCInst lowering code to generate those target expressions
where appropriate.

It also changes the asm parser to generate HA16/LO16 target
expressions when parsing assembler source that uses the
@ha / @l modifiers.  The effect is that now the above-
mentioned optimization automatically becomes available
for those situations too.
 

llvm-svn: 184436
2013-06-20 16:23:52 +00:00
Ulrich Weigand
e143b13aca [PowerPC] Support compare mnemonics with implied CR0
Just like for branch mnemonics (where support was recently added), the
assembler is supposed to support extended mnemonics for the compare
instructions where no condition register is specified explicitly
(and CR0 is assumed implicitly).

This patch adds support for those extended compare mnemonics.


Index: llvm-head/test/MC/PowerPC/ppc64-encoding-ext.s
===================================================================
--- llvm-head.orig/test/MC/PowerPC/ppc64-encoding-ext.s
+++ llvm-head/test/MC/PowerPC/ppc64-encoding-ext.s
@@ -449,21 +449,37 @@
 
 # CHECK: cmpdi 2, 3, 128                 # encoding: [0x2d,0x23,0x00,0x80]
          cmpdi 2, 3, 128
+# CHECK: cmpdi 0, 3, 128                 # encoding: [0x2c,0x23,0x00,0x80]
+         cmpdi 3, 128
 # CHECK: cmpd 2, 3, 4                    # encoding: [0x7d,0x23,0x20,0x00]
          cmpd 2, 3, 4
+# CHECK: cmpd 0, 3, 4                    # encoding: [0x7c,0x23,0x20,0x00]
+         cmpd 3, 4
 # CHECK: cmpldi 2, 3, 128                # encoding: [0x29,0x23,0x00,0x80]
          cmpldi 2, 3, 128
+# CHECK: cmpldi 0, 3, 128                # encoding: [0x28,0x23,0x00,0x80]
+         cmpldi 3, 128
 # CHECK: cmpld 2, 3, 4                   # encoding: [0x7d,0x23,0x20,0x40]
          cmpld 2, 3, 4
+# CHECK: cmpld 0, 3, 4                   # encoding: [0x7c,0x23,0x20,0x40]
+         cmpld 3, 4
 
 # CHECK: cmpwi 2, 3, 128                 # encoding: [0x2d,0x03,0x00,0x80]
          cmpwi 2, 3, 128
+# CHECK: cmpwi 0, 3, 128                 # encoding: [0x2c,0x03,0x00,0x80]
+         cmpwi 3, 128
 # CHECK: cmpw 2, 3, 4                    # encoding: [0x7d,0x03,0x20,0x00]
          cmpw 2, 3, 4
+# CHECK: cmpw 0, 3, 4                    # encoding: [0x7c,0x03,0x20,0x00]
+         cmpw 3, 4
 # CHECK: cmplwi 2, 3, 128                # encoding: [0x29,0x03,0x00,0x80]
          cmplwi 2, 3, 128
+# CHECK: cmplwi 0, 3, 128                # encoding: [0x28,0x03,0x00,0x80]
+         cmplwi 3, 128
 # CHECK: cmplw 2, 3, 4                   # encoding: [0x7d,0x03,0x20,0x40]
          cmplw 2, 3, 4
+# CHECK: cmplw 0, 3, 4                   # encoding: [0x7c,0x03,0x20,0x40]
+         cmplw 3, 4
 
 # FIXME: Trap mnemonics
 
Index: llvm-head/lib/Target/PowerPC/PPCInstrInfo.td
===================================================================
--- llvm-head.orig/lib/Target/PowerPC/PPCInstrInfo.td
+++ llvm-head/lib/Target/PowerPC/PPCInstrInfo.td
@@ -2201,3 +2201,12 @@ defm : BranchExtendedMnemonic<"ne", 68>;
 defm : BranchExtendedMnemonic<"nu", 100>;
 defm : BranchExtendedMnemonic<"ns", 100>;
 
+def : InstAlias<"cmpwi $rA, $imm", (CMPWI CR0, gprc:$rA, s16imm:$imm)>;
+def : InstAlias<"cmpw $rA, $rB", (CMPW CR0, gprc:$rA, gprc:$rB)>;
+def : InstAlias<"cmplwi $rA, $imm", (CMPLWI CR0, gprc:$rA, u16imm:$imm)>;
+def : InstAlias<"cmplw $rA, $rB", (CMPLW CR0, gprc:$rA, gprc:$rB)>;
+def : InstAlias<"cmpdi $rA, $imm", (CMPDI CR0, g8rc:$rA, s16imm:$imm)>;
+def : InstAlias<"cmpd $rA, $rB", (CMPD CR0, g8rc:$rA, g8rc:$rB)>;
+def : InstAlias<"cmpldi $rA, $imm", (CMPLDI CR0, g8rc:$rA, u16imm:$imm)>;
+def : InstAlias<"cmpld $rA, $rB", (CMPLD CR0, g8rc:$rA, g8rc:$rB)>;
+

llvm-svn: 184435
2013-06-20 16:15:12 +00:00
Evgeniy Stepanov
be5fa31841 Fix get_magic() handling of short reads.
PR16389

llvm-svn: 184434
2013-06-20 15:56:05 +00:00
Rafael Espindola
dc37cdb22d Rename fs::GetUniqueID to fs::getUniqueID to match the style guide.
llvm-svn: 184431
2013-06-20 15:06:35 +00:00
Evgeniy Stepanov
0d9af4e442 Remove MSan hack that is no longer needed.
llvm-svn: 184428
2013-06-20 14:19:10 +00:00
Vladimir Medic
af5979fc83 Optimize register parsing for MipsAsmParser. Allow symbolic aliases for FPU registers.
llvm-svn: 184411
2013-06-20 11:21:49 +00:00
David Blaikie
e21853eb2f DebugInfo: don't use location lists when the location covers the whole function anyway
Fix up three tests - one that was relying on abbreviation number,
another relying on a location list in this case (& testing raw asm,
changed that to use dwarfdump on the debug_info now that that's where
the location is), and another which was added in r184368 - exposing a
bug in that fix that is exposed when we emit the location inline rather
than through a location list. Fix that bug while I'm here.

llvm-svn: 184387
2013-06-20 00:25:24 +00:00
Argyrios Kyrtzidis
5fc60f0cfb [Support/CrashRecoveryContext] Make sure CrashRecoveryContext does not clear the thread-local "CurrentContext"
in the "parent" thread, when we are using CrashRecoveryContext::RunSafelyOnThread.

When using CrashRecoveryContext::RunSafelyOnThread, we would set a CrashRecoveryContextImpl* to a thread-local variable
for the "child" thread, but CrashRecoveryContext would erroneously clear it in the "parent" thread.

The result was that if CrashRecoveryContext::RunSafelyOnThread was called again in the "child" thread it would mess up
crash-recovery for its parent.

A test for this will be added in the clang repository.
rdar://14204560

llvm-svn: 184380
2013-06-19 22:53:45 +00:00
Bill Wendling
f3befd916e This is now a duplicate.
llvm-svn: 184376
2013-06-19 22:16:33 +00:00
Bill Wendling
3cff8f16d4 Make the comparison operators non-member functions.
llvm-svn: 184373
2013-06-19 22:09:25 +00:00
Bill Wendling
49f45f9861 Don't pass in the TargetInstrInfo into the register info object. It doesn't use it.
llvm-svn: 184369
2013-06-19 21:59:00 +00:00
David Blaikie
c3cec14be6 DebugInfo: PR14763/r183329 correct the location of indirect parameters
We had been papering over a problem with location info for non-trivial
types passed by value by emitting their type as references (this caused
the debugger to interpret the location information correctly, but broke
the type of the function). r183329 corrected the type information but
lead to the debugger interpreting the pointer parameter as the value -
the debug info describing the location needed an extra dereference.

Use a new flag in DIVariable to add the extra indirection (either by
promoting an existing DW_OP_reg (parameter passed in a register) to
DW_OP_breg + 0 or by adding DW_OP_deref to an existing DW_OP_breg + n
(parameter passed on the stack).

llvm-svn: 184368
2013-06-19 21:55:13 +00:00
David Blaikie
efeec21da2 Spell correct (s/begining/beginning/)
llvm-svn: 184362
2013-06-19 21:42:05 +00:00
David Blaikie
7637c0313e llvm-dwarfdump: Add support for dumping the .debug_loc section
This is a basic implementation - we still don't have any support (that I
know of) for dumping DWARF expressions in a meaningful way, so the
location information itself is just printed as a sequence of bytes as we
do elsewhere.

llvm-svn: 184361
2013-06-19 21:37:13 +00:00
Bill Wendling
a9576dc938 Access the TargetLoweringInfo from the TargetMachine object instead of caching it. The TLI may change between functions. No functionality change.
llvm-svn: 184360
2013-06-19 21:36:55 +00:00
Ulrich Weigand
ef862011f0 [MC/DWARF] Generate multiple .debug_line entries for adjacent .loc directives
The compiler occasionally generates multiple .loc directives in a row
(at the same instruction address).  These need to be transformed into
multple actual .debug_line table entries, since they are used to signal
certain information to the debugger (e.g. if the opening brace of a
function body is on the same line as the declaration).

The MCAsmStreamer version of EmitDwarfLocDirective handles this
correctly by emitting a .loc directive every time it is called.
However, the MCObjectStream version simply defaults to recording
the information and emitting only a single table entry later,
e.g. when EmitInstruction is called.

This patch introduces a MCAsmStreamer::EmitDwarfLocDirective
version that emits a line table entry for a .loc directive
that may already be pending before recording the new directive.
(This is similar to how this is handled in GNU as.)

With this patch (and the code alignment factor patch) applied,
I'm now getting identical DWARF .debug sections for all test-suite
object files on PowerPC for the internal and the external assembler.

llvm-svn: 184357
2013-06-19 21:27:27 +00:00
Michael Gottesman
649738ce71 [APFloat] Converted all references to APFloat::isNormal => APFloat::isFiniteNonZero.
Turns out all the references were in llvm and not in clang.

llvm-svn: 184356
2013-06-19 21:23:18 +00:00
Bill Wendling
4d82ecded8 Access the TargetLoweringInfo from the TargetMachine object instead of caching it. The TLI may change between functions. No functionality change.
llvm-svn: 184352
2013-06-19 21:07:11 +00:00
Aaron Ballman
406fa22a89 Modified the implementation of fs::GetUniqueID on Windows such that it actually finds a unique identifier for a file. Also adds unit tests for GetUniqueID.
llvm-svn: 184351
2013-06-19 21:03:50 +00:00
Bill Wendling
1919cdf3c7 Access the TargetLoweringInfo from the TargetMachine object instead of caching it. The TLI may change between functions. No functionality change.
llvm-svn: 184349
2013-06-19 20:51:24 +00:00
Bill Wendling
dbd80b66e0 Don't cache the TLI object since we have access to it through TargetMachine already.
llvm-svn: 184346
2013-06-19 20:32:16 +00:00
Ahmed Bougacha
8596c56ff2 Allow creation of single-byte MCAtoms.
llvm-svn: 184344
2013-06-19 20:18:59 +00:00
Matt Arsenault
fb5518e48b Move StructurizeCFG out of R600 to generic Transforms.
Register it with PassManager

llvm-svn: 184343
2013-06-19 20:18:24 +00:00
Quentin Colombet
4633bd4a55 LSR: Fix the parameters used to compute the scaling factor cost.
Prior to this change, the considered addressing modes may be invalid since the
maximum and minimum offsets were not taking into account.
This was causing an assertion failure.

The added test case exercices that behavior.

<rdar://problem/14199725> Assertion failed: (CurScaleCost >= 0 && "Legal
addressing mode has an illegal cost!")

llvm-svn: 184341
2013-06-19 19:59:41 +00:00
Nadav Rotem
a578c6d3ad SLPVectorizer: handle scalars that are extracted from vectors (using ExtractElementInst).
llvm-svn: 184325
2013-06-19 17:33:16 +00:00
Nadav Rotem
79be778ce2 SLPVectorizer: start constructing chains at stores that are not power of two.
The type <3 x i8> is a common in graphics and we want to be able to vectorize it.

This changes accelerates bullet by 12% and 471_omnetpp by 5%.

llvm-svn: 184317
2013-06-19 15:57:29 +00:00
Rafael Espindola
8db1ef8cde Remove Path::getDirectoryContents.
llvm-svn: 184311
2013-06-19 15:32:37 +00:00
Rafael Espindola
24a81dcac4 Remove Path::isObjectFile.
llvm-svn: 184305
2013-06-19 14:25:38 +00:00
Rafael Espindola
9f3be55a57 Remove Path::canExecute.
llvm-svn: 184298
2013-06-19 13:25:31 +00:00
Vladimir Medic
10551de6bd The RenderMethod field in RegisterOperand class sets the name of the method on the target specific operand to call to add the target specific operand to an MCInst. This patch defines RenderMethod for mips RegisterOperand classes and removes redundant code from MipsAsmParser.cpp
llvm-svn: 184292
2013-06-19 10:14:36 +00:00
NAKAMURA Takumi
e8b9470337 MachOUniversal.cpp: Fix abuse of Twine. It would be sufficient to use std::string instead.
llvm-svn: 184291
2013-06-19 09:55:05 +00:00
Michael Gottesman
f89e76a9ad Fixed comment typo that causes the given comment to actually make sense.
llvm-svn: 184286
2013-06-19 07:34:21 +00:00
Nadav Rotem
61c4560eab SLPVectorizer: vectorize compares and selects.
llvm-svn: 184282
2013-06-19 05:49:52 +00:00
Nadav Rotem
9accad7fa1 Document the return value and fix a typo.
llvm-svn: 184281
2013-06-19 05:47:33 +00:00
Sean Silva
a39ac0fdeb [yaml2obj][ELF] Support ELFOSABI_* enum.
llvm-svn: 184268
2013-06-19 00:55:28 +00:00
Sean Silva
c7a5f8cb18 [yaml2obj][ELF] Support st_info through Binding and Type YAML keys.
llvm-svn: 184263
2013-06-19 00:11:59 +00:00
Matt Arsenault
fac93f05f8 Use GetUnderlyingObject instead of custom function
llvm-svn: 184261
2013-06-18 23:37:58 +00:00
Sean Silva
beed0c8948 [yaml2obj][ELF] Rudimentary symbol table support.
Currently, we only output the name.

llvm-svn: 184255
2013-06-18 23:14:03 +00:00
Jim Grosbach
0f0c0ac8be ARM: Add optional datatype suffix to NEON mvn asm syntax.
rdar://14194152

llvm-svn: 184244
2013-06-18 21:49:21 +00:00
Bill Wendling
025f285316 We want a string representation of the attribute, not the kind as a string.
llvm-svn: 184239
2013-06-18 21:27:00 +00:00
Rafael Espindola
7250573745 Remove Path::canWrite.
llvm-svn: 184235
2013-06-18 21:10:03 +00:00
Rafael Espindola
40fa7cd224 Add a can_write function to PathV2.
llvm-svn: 184233
2013-06-18 20:56:38 +00:00
Michael Gottesman
5a5656f17d [ARMTargetLowering] ARMISD::{SUB,ADD}{C,E} second result is a boolean implying that upper bits are always 0.
llvm-svn: 184231
2013-06-18 20:49:45 +00:00
Michael Gottesman
dde9797dc2 Converted an overly aggressive assert to a conditional check in AddCombineTo64bitMLAL.
Said assert assumes that ADDC will always have a glue node as its second
argument and is checked before we even know that we are actually performing the
relevant MLAL optimization. This is incorrect since on ARM we *CAN* codegen ADDC
with a use list based second argument. Thus to have both effects, I converted
the assert to a conditional check which if it fails we do not perform the
optimization.

In terms of tests I can not produce an ADDC from the IR level until I get in my
multiprecision optimization patch which is forthcoming. The tests for said patch
would cause this assert to fail implying that said tests will provide the
relevant tests.

llvm-svn: 184230
2013-06-18 20:49:40 +00:00
Rafael Espindola
9c21fca143 Remove unused Path::canRead.
llvm-svn: 184229
2013-06-18 20:42:25 +00:00
Nadav Rotem
742cff8193 Fix 80 col violation.
llvm-svn: 184228
2013-06-18 20:41:52 +00:00
Kevin Enderby
cb41cc56c6 Change the arm assembler to support this from the v7c spec:
"When assembling to the ARM instruction set, the .N qualifier produces
an assembler error and the .W qualifier has no effect."

In the pre-matcher handler in the asm parser the ".w" (wide) qualifier 
when in ARM mode is now discarded. And an error message is now
produced when the ".n" (narrow) qualifier is used in ARM mode.

Test cases for these were added.

rdar://14064574

llvm-svn: 184224
2013-06-18 20:19:24 +00:00
Quentin Colombet
337e6e6d1f During SelectionDAG building explicitly set a node to constant zero when the
value is zero.
This allows optmizations to kick in more easily.
Fix some test cases so that they remain meaningful (i.e., not completely dead
coded) when optimizations apply.

<rdar://problem/14096009> superfluous multiply by high part of zero-extended
value.

llvm-svn: 184222
2013-06-18 20:14:39 +00:00
Jack Carter
016185840e Mips ELF: Mark object file as ABI compliant
When producing objects that are abi compliant we are 
marking neither the object file nor the assembly file
correctly and thus generate warnings. 

We need to set the EF_CPIC flag in the ELF header when
generating direct object.

Note that the warning is only generated when compiling without PIC.

When compiling with clang the warning will be suppressed by supplying:

 -Wa,-mno-shared -Wa,-call_nonpic

Also the following directive should also be added:

	.option	pic0

when compiling without PIC,  This eliminates the need for supplying:

  -mno-shared -call_nonpic

on the assembler command line.

Patch by Douglas Gilmore

llvm-svn: 184220
2013-06-18 19:47:15 +00:00
Rafael Espindola
9cac309394 Remove uniqueID from PathV1.h.
llvm-svn: 184219
2013-06-18 19:46:19 +00:00
Rafael Espindola
c014b80c02 Add a GetUniqueID that will replace the uniqueID of PathV1.h.
llvm-svn: 184217
2013-06-18 19:34:49 +00:00
David Blaikie
9a98240ce6 Reduce indentation.
llvm-svn: 184213
2013-06-18 18:03:17 +00:00
Stefanus Du Toit
aa267b3e82 Add support for encoding the HLE XACQUIRE and XRELEASE prefixes.
For decoding, keep the current behavior of always decoding these as their REP
versions. In the future, this could be improved to recognize the cases where
these behave as XACQUIRE and XRELEASE and decode them as such.

llvm-svn: 184207
2013-06-18 17:08:10 +00:00
Rafael Espindola
18bf1abdc7 Add a version of unique_file that return just the file name.
llvm-svn: 184206
2013-06-18 17:01:00 +00:00
Nadav Rotem
6796716256 Scan the successor blocks and use the PHI nodes as a hint for possible chain roots.
llvm-svn: 184201
2013-06-18 15:58:05 +00:00
Nadav Rotem
c7a7b98ec1 Add a return value to make this function more useful.
llvm-svn: 184200
2013-06-18 15:57:12 +00:00
Alexey Samsonov
50c414e3d0 Basic support for parsing Mach-O universal binaries in LLVMObject library
llvm-svn: 184191
2013-06-18 15:03:28 +00:00
Rafael Espindola
0d881ffff7 Don't convert object_error's enum to and from int.
This allows the compiler to see the enum and warn about it. While in here,
fix a switch to not use a default and fix style violations.

llvm-svn: 184186
2013-06-18 13:30:31 +00:00
Amaury de la Vieuville
0c0f005a15 ARM: fix literal load with positive offset encoding
When using a positive offset, literal loads where encoded
as if it was negative, because:
- The sign bit was not assigned to an operand
- The addrmode_imm12 operand was not encoding the sign bit correctly

This patch also makes the assembler look at the .w/.n specifier for
loads.

llvm-svn: 184182
2013-06-18 08:13:05 +00:00
Amaury de la Vieuville
f28bf33894 ARM: add operands pre-writeback variants when needed
llvm-svn: 184181
2013-06-18 08:12:51 +00:00
Amaury de la Vieuville
8d8456b196 ARM: fix thumb literal loads decoding
This fixes two previous issues:
- Negative offsets were not correctly disassembled
- The decoded opcodes were not the right one

llvm-svn: 184180
2013-06-18 08:03:06 +00:00
Amaury de la Vieuville
e6ed8ad5df ARM: thumb stores cannot use PC as dest register
llvm-svn: 184179
2013-06-18 08:02:56 +00:00
Timur Iskhodzhanov
60775c9cf7 Hopefully fix the MSVS build after r184105
llvm-svn: 184178
2013-06-18 07:57:22 +00:00
Bill Wendling
49ef14ef73 Use pointers to the MCAsmInfo and MCRegInfo.
Someone may want to do something crazy, like replace these objects if they
change or something.

No functionality change intended.

llvm-svn: 184175
2013-06-18 07:20:20 +00:00
Nick Lewycky
eed4be4827 Fix nondeterminism in .gcno file generation.
llvm-svn: 184174
2013-06-18 06:38:21 +00:00
Bill Wendling
6ec4332633 Remove dead prototype.
llvm-svn: 184173
2013-06-18 06:24:14 +00:00
Bill Wendling
0dd1843240 Simplify some of the code. No functionality change.
llvm-svn: 184172
2013-06-18 06:07:26 +00:00
Andrew Trick
797eafc983 MI-Sched: handle ReadAdvance latencies as used by Swift.
llvm-svn: 184135
2013-06-17 21:45:18 +00:00
Andrew Trick
af98a3de61 Give RegMax higher priority.
llvm-svn: 184133
2013-06-17 21:45:13 +00:00
Andrew Trick
8f4c33cf71 Remove compareRPDelta.
A complex, expensive heuristic with little value in the current design.

llvm-svn: 184132
2013-06-17 21:45:11 +00:00
Andrew Trick
94506beb69 MI Sched: fix a typo in RegPressure heuristics.
llvm-svn: 184131
2013-06-17 21:45:09 +00:00
Andrew Trick
7970f2c8b7 MI-Sched: Remove another heuristic that is sensitive to queue order.
llvm-svn: 184130
2013-06-17 21:45:07 +00:00
Andrew Trick
35a0502f74 MI-Sched: Track multiple candidates with the same priority level.
This eliminates the MultiPressure scheduling "reason". It was
sensitive to queue order. We don't like being sensitive to queue
order.

llvm-svn: 184129
2013-06-17 21:45:05 +00:00
Bill Wendling
6f94f75bda Directly access objects which may change during compilation.
llvm-svn: 184121
2013-06-17 20:41:25 +00:00
Rafael Espindola
344b614949 Reapply r183985 now that the missing check was added to PathV2.
llvm-svn: 184120
2013-06-17 20:37:56 +00:00
Rafael Espindola
81867d6723 Only delete regular files and directories.
This ports a missing feature from PathV1.h. I am not sure how to test this
with the regular infrastructure, but an Apple bot should check this when
r183985 is reapplied.

llvm-svn: 184119
2013-06-17 20:35:51 +00:00
Vincent Lejeune
e4a87c6317 R600: PV stores Reg id, not index
llvm-svn: 184117
2013-06-17 20:16:40 +00:00
Vincent Lejeune
b04cbc8058 R600: Properly set COUNT_3 bit in TEX clause initiating inst for pre EG gen.
Fixes rv7x0 bug in Heaven reported here:
https://bugs.freedesktop.org/show_bug.cgi?id=64257

llvm-svn: 184116
2013-06-17 20:16:26 +00:00
Rafael Espindola
8a9592657a Revert "Remove a use of PathV1.h."
This reverts commit r183985.

We were missing the checks for not deleting things like /dev/null.

llvm-svn: 184111
2013-06-17 19:54:17 +00:00
Benjamin Kramer
2934370512 Switch spill weights from a basic loop depth estimation to BlockFrequencyInfo.
The main advantages here are way better heuristics, taking into account not
just loop depth but also __builtin_expect and other static heuristics and will
eventually learn how to use profile info. Most of the work in this patch is
pushing the MachineBlockFrequencyInfo analysis into the right places.

This is good for a 5% speedup on zlib's deflate (x86_64), there were some very
unfortunate spilling decisions in its hottest loop in longest_match(). Other
benchmarks I tried were mostly neutral.

This changes register allocation in subtle ways, update the tests for it.
2012-02-20-MachineCPBug.ll was deleted as it's very fragile and the instruction
it looked for was gone already (but the FileCheck pattern picked up unrelated
stuff).

llvm-svn: 184105
2013-06-17 19:00:36 +00:00
Pekka Jaaskelainen
4f4b7ec54b Fix for a regression caused by the LoopVectorizer when
vectorizing loops with memory accesses to non-zero address spaces. It
simply dropped the AS info. Fixes PR16306.

llvm-svn: 184103
2013-06-17 18:49:06 +00:00
Rafael Espindola
2b411d1243 Don't use PathV1.h in LTOCodeGenerator.cpp
This patch also adds a simpler version of sys::fs::remove and a tool_output_file
constructor for when we already have an open file.

llvm-svn: 184095
2013-06-17 18:05:35 +00:00
Nadav Rotem
7c4739e05a Disable vectorization for -Oz.
llvm-svn: 184089
2013-06-17 17:22:40 +00:00
Nadav Rotem
5dfa56605f Enable the loop vectorizer by default for -Os and -O2.
llvm-svn: 184084
2013-06-17 16:23:34 +00:00
Rafael Espindola
845bfd3735 Move lib/Archive to tools/llvm-ar.
llvm-ar is the only tool that needs to write archive files. Every other tool
should be able to use the lib/Object interface.

llvm-svn: 184083
2013-06-17 15:47:20 +00:00
Manuel Klimek
2a1720f206 Fix incorrectly finding 'executable' directories instead of files.
This broke for example the 'not' utility, if a directory called
'FileCheck' is executable and in the path before the actual 'FileCheck'.

This patch steals the implementation of the "old" PathV1 canExecute
implementation:
- checks for R_OK (file readable): this is necessary for executing
  scripts; we should not regress here unless we have good reasons
- checks for S_ISREG; if we want to get rid of this, we'd need to
  change all callers who already made the assumption when depending
  on Path V1.

llvm-svn: 184074
2013-06-17 10:48:34 +00:00
David Blaikie
813e6b3974 DebugInfo: remove target-specific Frame Index handling for DBG_VALUE MachineInstrs
Frame index handling is now target-agnostic, so delete the target hooks
for creation & asm printing of target-specific addressing in DBG_VALUEs
and any related functions.

llvm-svn: 184067
2013-06-16 20:34:27 +00:00
David Blaikie
f3d2951503 Debug Info: Simplify Frame Index handling in DBG_VALUE Machine Instructions
Rather than using the full power of target-specific addressing modes in
DBG_VALUEs with Frame Indicies, simply use Frame Index + Offset. This
reduces the complexity of debug info handling down to two
representations of values (reg+offset and frame index+offset) rather
than three or four.

Ideally we could ensure that frame indicies had been eliminated by the
time we reached an assembly or dwarf generation, but I haven't spent the
time to figure out where the FIs are leaking through into that & whether
there's a good place to convert them. Some FI+offset=>reg+offset
conversion is done (see PrologEpilogInserter, for example) which is
necessary for some SelectionDAG assumptions about registers, I believe,
but it might be possible to make this a more thorough conversion &
ensure there are no remaining FIs no matter how instruction selection
is performed.

llvm-svn: 184066
2013-06-16 20:34:15 +00:00
Benjamin Kramer
5eda60b023 Silence warning in Release builds.
llvm-svn: 184059
2013-06-16 11:29:48 +00:00
David Blaikie
7a29358013 DebugInfo: print DBG_VALUE MachineInstrs with [] for deref and drop the offset when it's zero
llvm-svn: 184045
2013-06-15 15:52:58 +00:00
Jakub Staszak
6fe8ea3c17 Use 0 instead of NULL.
llvm-svn: 184044
2013-06-15 12:20:44 +00:00
Benjamin Kramer
7c4e240147 PruneEH: Only merge attribute sets when used. No functionality change.
llvm-svn: 184041
2013-06-15 10:55:39 +00:00
Andrew Trick
55c8a4e3e5 Missing NDEBUGs.
llvm-svn: 184039
2013-06-15 05:46:47 +00:00
Andrew Trick
ba2de01078 MI-Sched: heuristics using the new latency and machine model.
llvm-svn: 184038
2013-06-15 05:39:19 +00:00
Andrew Trick
768a74cb96 Support BufferSize on ProcResGroup for unified MOp schedulers.
And add Sandybridge/Haswell resource buffers.

llvm-svn: 184034
2013-06-15 04:50:06 +00:00
Andrew Trick
31eeff56c7 Update machine models. Specify buffer sizes for OOO processors.
llvm-svn: 184033
2013-06-15 04:50:02 +00:00
Andrew Trick
5d13fe97ed Machine Model: Add MicroOpBufferSize and resource BufferSize.
Replace the ill-defined MinLatency and ILPWindow properties with
with straightforward buffer sizes:
MCSchedMode::MicroOpBufferSize
MCProcResourceDesc::BufferSize

These can be used to more precisely model instruction execution if desired.

Disabled some misched tests temporarily. They'll be reenabled in a few commits.

llvm-svn: 184032
2013-06-15 04:49:57 +00:00
Andrew Trick
e874623046 MI-Sched: Rename IssueCount to CurrMOps.
"Counts" refer to scaled resource counts within a region. CurrMOps is
simply the number of micro-ops to be issue in the current cycle.

llvm-svn: 184031
2013-06-15 04:49:49 +00:00
Andrew Trick
be4026d9a8 MI-Sched: Remove the temporary EnableCopyConstrain flag.
llvm-svn: 184030
2013-06-15 04:49:46 +00:00
Andrew Trick
7c68d011b0 MI-Sched: added tracking of dependent latency for better heuristics.
Heuristics compare the critical path in the scheduled code, called
ExpectedLatency, with the latency of instructions remaining to be
scheduled. There are two ways to look at remaining latency:

(1) Dependent latency includes the latency between unscheduled and
scheduled instructions.

(2) Independent latency is simply the height (bottom-up) or depth
(top-down) of instructions currently in the ready Q.

llvm-svn: 184029
2013-06-15 04:49:44 +00:00
Andrew Trick
359d7832e6 MI-Sched: DEBUG: print critical resource.
llvm-svn: 184028
2013-06-15 04:49:42 +00:00
Stephen Lin
106aaf56d4 SelectionDAG: slightly refactor DAGCombiner::visitSELECT_CC to avoid redudant checks...
This doesn't really effect performance due to all the relevant calls being transparent but is clearer. 

llvm-svn: 184027
2013-06-15 04:03:33 +00:00
David Blaikie
d1a8512cd8 Debug Info: Don't print the display name and colon prefix for DEBUG_VALUE comments if the display name is empty
llvm-svn: 184026
2013-06-15 00:33:47 +00:00
Sean Silva
7dafd05c2e [yaml2obj] Add support for sh_link via Link key.
llvm-svn: 184022
2013-06-15 00:25:26 +00:00
Tom Stellard
0f71ebc5a8 R600: Add SI load support for v[24]i32 and store for v2i32
Also add a seperate vector lit test file, since r600 doesn't seem to handle
v2i32 load/store yet, but we can test both for SI.

Patch by: Aaron Watry

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 184021
2013-06-15 00:09:31 +00:00
Rafael Espindola
daa7f712a2 Remove the LLVM specific archive index.
Archive files (.a) can have a symbol table indicating which object
files in them define which symbols. The purpose of this symbol table
is to speed up linking by allowing the linker the read only the .o
files it is actually going to use instead of having to parse every
object's symbol table.

LLVM's archive library currently supports a LLVM specific format for
such table. It is hard to see any value in that now that llvm-ld is
gone:

* System linkers don't use it: GNU ar uses the same plugin as the
linker to create archive files with a regular index. The OS X ar
creates no symbol table for IL files, I assume the linker just parses
all IL files.

* It doesn't interact well with archives having both IL and native objects.

* We probably don't want to be responsible for yet another archive
format variant.

This patch then:

* Removes support for creating and reading such index from lib/Archive.
* Remove llvm-ranlib, since there is nothing left for it to do.

We should in the future add support for regular indexes to llvm-ar for
both native and IL objects. When we do that, llvm-ranlib should be
reimplemented as a symlink to llvm-ar, as it is equivalent to "ar s".

llvm-svn: 184019
2013-06-14 23:25:53 +00:00
Tom Stellard
428a19228a R600: Use correct encoding for Vertex Fetch instructions on Cayman
Reviewed-by: Vincent Lejeune<vljn at ovi.com>
llvm-svn: 184016
2013-06-14 22:12:30 +00:00
Tom Stellard
c25852891f R600: Use EXPORT_RAT_INST_STORE_DWORD for stores on Cayman
We were using RAT_INST_STORE_RAW, which seemed to work, but the docs
say this instruction doesn't exist for Cayman, so it's probably safer
to use a documented instruction instead.

Reviewed-by: Vincent Lejeune<vljn at ovi.com>
llvm-svn: 184015
2013-06-14 22:12:24 +00:00
Tom Stellard
a3b0b87105 R600: Factor the instruction encoding out the RAT_WRITE_CACHELESS_eg class
Reviewed-by: Vincent Lejeune<vljn at ovi.com>
llvm-svn: 184014
2013-06-14 22:12:19 +00:00
Tom Stellard
9f063c72c3 R600: Move instruction encoding definitions into a separate .td file
Reviewed-by: Vincent Lejeune<vljn at ovi.com>
llvm-svn: 184013
2013-06-14 22:12:09 +00:00
Matt Arsenault
8aacc4b4a3 Introduce getSelect usage and use more getSelectCC
llvm-svn: 184012
2013-06-14 22:04:37 +00:00
Rafael Espindola
61f7e167f2 Add GetCurrentDirectory back.
It looks like clang-tools-extra/unittests/cpp11-migrate/TransformTest.cpp
depends on the behaviour of the old one on Windows. Maybe a difference
between GetCurrentDirectoryA and GetCurrentDirectoryW?

llvm-svn: 184009
2013-06-14 21:41:33 +00:00
Stephen Lin
692dd368c7 SelectionDAG: minor fix to order of operands in comments to match the code
llvm-svn: 184008
2013-06-14 21:33:58 +00:00
Rafael Espindola
9534308a00 Replace use of PathV1.h in MCContext.cpp.
GetCurrentDirectory is now unused. Remove it.

llvm-svn: 184003
2013-06-14 20:26:58 +00:00
Tim Northover
11fabb62e9 Mark rematerialized super/sub registers as dead.
When we're rematerializing into a not-quite-right register we already add the
real definition as an imp-def, but we should also be marking the "official"
register as dead, since nothing else is going to use it as a result of this
remat.

Not doing this can affect pressure tracking.

rdar://problem/14158833

llvm-svn: 184002
2013-06-14 20:22:21 +00:00
Rafael Espindola
109393c56d Replace use of PathV1.h in Program.cpp.
llvm-svn: 183996
2013-06-14 19:38:45 +00:00
Stephen Lin
ccd266c666 SelectionDAG: Fix incorrect condition checks in some cases of folding FADD/FMUL combinations; also improve accuracy of comments
llvm-svn: 183993
2013-06-14 18:17:35 +00:00
Rafael Espindola
9d4329e0fb Remove unused argument.
llvm-svn: 183992
2013-06-14 18:12:13 +00:00
Rafael Espindola
9f0c1fe5ad Don't use PathV1.h in GraphWriter.cpp.
llvm-svn: 183988
2013-06-14 17:11:14 +00:00
Rafael Espindola
4430795d30 Convert a use of sys::Path::GetTemporaryDirectory.
llvm-svn: 183987
2013-06-14 16:43:15 +00:00
Rafael Espindola
b3ffa88108 Remove a use of PathV1.h.
llvm-svn: 183985
2013-06-14 16:20:18 +00:00
Derek Schuff
4c429cad03 Make PrologEpilogInserter save/restore all callee saved registers
in functions which call __builtin_unwind_init()

__builtin_unwind_init() is an undocumented gcc intrinsic which has this effect,
and is used in libgcc_eh.

Goes part of the way toward fixing PR8541.

llvm-svn: 183984
2013-06-14 16:15:29 +00:00
Rafael Espindola
3e13459e12 Remove a use of PathV1.h.
llvm-svn: 183982
2013-06-14 15:24:56 +00:00
Rafael Espindola
703b03a992 Move PrependMainExecutablePath next to its only user.
llvm-svn: 183980
2013-06-14 15:12:13 +00:00
Rafael Espindola
7a9e435747 Remove a use of sys::Path.
llvm-svn: 183979
2013-06-14 13:59:21 +00:00
Amaury de la Vieuville
13c4894a31 ARM: fix thumb coprocessor instruction with pre-writeback disassembly
was        stc2 p0, c0, [r0]!
instead of stc2 p0, c0, [r0,#0]!

llvm-svn: 183975
2013-06-14 11:21:35 +00:00
Benjamin Kramer
a0c15494c5 X86: cvtpi2ps is just an SSE instruction with MMX operands. It has no AVX equivalent.
Give it the right register format so we can also emit it when AVX is enabled.

llvm-svn: 183971
2013-06-14 09:31:41 +00:00
JF Bastien
cb60eaba94 Enable FastISel on ARM for Linux and NaCl, not MCJIT
This is a resubmit of r182877, which was reverted because it broken
MCJIT tests on ARM. The patch leaves MCJIT on ARM as it was before: only
enabled for iOS. I've CC'ed people from the original review and revert.

FastISel was only enabled for iOS ARM and Thumb2, this patch enables it
for ARM (not Thumb2) on Linux and NaCl, but not MCJIT.

Thumb2 support needs a bit more work, mainly around register class
restrictions.

The patch punts to SelectionDAG when doing TLS relocation on non-Darwin
targets. I will fix this and other FastISel-to-SelectionDAG failures in
a separate patch.

The patch also forces FastISel to retain frame pointers: iOS always
keeps them for backtracking (so emitted code won't change because of
this), but Linux was getting much worse code that was incorrect when
using big frames (such as test-suite's lencod). I'll also fix this in a
later patch, it will probably require a peephole so that FastISel
doesn't rematerialize frame pointers back-to-back.

The test changes are straightforward, similar to:
  http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20130513/174279.html
They also add a vararg test that got dropped in that change.

I ran all of lnt test-suite on A15 hardware with --optimize-option=-O0
and all the tests pass. All the tests also pass on x86 make check-all. I
also re-ran the check-all tests that failed on ARM, and they all seem to
pass.

llvm-svn: 183966
2013-06-14 02:49:43 +00:00
Sean Silva
221b8835d3 [yaml2obj] Add support for sh_addralign via AddressAlign key.
For consistency, change the address in the test case from 0xDEADBEEF to
0xCAFEBABE since 0xCAFEBABE that actually has a 2-byte alignment.

llvm-svn: 183962
2013-06-14 00:38:02 +00:00