oota-llvm.git
9 years agoInitialize new subtarget feature variable for generating reciprocal estimate instruct...
Sanjay Patel [Tue, 11 Nov 2014 23:13:15 +0000 (23:13 +0000)]
Initialize new subtarget feature variable for generating reciprocal estimate instructions.

This was missed in r221706.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221731 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agolibLTO: Assert if LTOCodeGenerator and LTOModule are from different contexts
Duncan P. N. Exon Smith [Tue, 11 Nov 2014 23:13:10 +0000 (23:13 +0000)]
libLTO: Assert if LTOCodeGenerator and LTOModule are from different contexts

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221730 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[FastISel][AArch64] Add support for fabs intrinsic.
Juergen Ributzka [Tue, 11 Nov 2014 23:10:44 +0000 (23:10 +0000)]
[FastISel][AArch64] Add support for fabs intrinsic.

Lower the llvm.fabs intrinsic to the 'fabs' MI instruction.

This fixes rdar://problem/18946552.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221729 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agolibLTO: Allow LTOModule to own a context
Duncan P. N. Exon Smith [Tue, 11 Nov 2014 23:08:05 +0000 (23:08 +0000)]
libLTO: Allow LTOModule to own a context

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221728 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agolibLTO: Allow LTOCodeGenerator to own a context
Duncan P. N. Exon Smith [Tue, 11 Nov 2014 23:03:29 +0000 (23:03 +0000)]
libLTO: Allow LTOCodeGenerator to own a context

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221726 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[asan] adding ShadowOffset64 for mips64, patch by Kumar Sukhani
Kostya Serebryany [Tue, 11 Nov 2014 23:02:57 +0000 (23:02 +0000)]
[asan] adding ShadowOffset64 for mips64, patch by Kumar Sukhani

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221725 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Reassociate] Canonicalize negative constants out of expressions.
Chad Rosier [Tue, 11 Nov 2014 22:58:35 +0000 (22:58 +0000)]
[Reassociate] Canonicalize negative constants out of expressions.

This is a reapplication of r221171, but we only perform the transformation
on expressions which include a multiplication.  We do not transform rem/div
operations as this doesn't appear to be safe in all cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221721 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMove asan-coverage into a separate phase.
Kostya Serebryany [Tue, 11 Nov 2014 22:14:37 +0000 (22:14 +0000)]
Move asan-coverage into a separate phase.

Summary:
This change moves asan-coverage instrumentation
into a separate Module pass.
The other part of the change in clang introduces a new flag
-fsanitize-coverage=N.
Another small patch will update tests in compiler-rt.

With this patch no functionality change is expected except for the flag name.
The following changes will make the coverage instrumentation work with tsan/msan

Test Plan: Run regression tests, chromium.

Reviewers: nlewycky, samsonov

Reviewed By: nlewycky, samsonov

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6152

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221718 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert "IR: MDNode => Value"
Duncan P. N. Exon Smith [Tue, 11 Nov 2014 21:30:22 +0000 (21:30 +0000)]
Revert "IR: MDNode => Value"

Instead, we're going to separate metadata from the Value hierarchy.  See
PR21532.

This reverts commit r221375.
This reverts commit r221373.
This reverts commit r221359.
This reverts commit r221167.
This reverts commit r221027.
This reverts commit r221024.
This reverts commit r221023.
This reverts commit r220995.
This reverts commit r220994.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221711 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix build break: remove unused variable in FCFI.
Tom Roeder [Tue, 11 Nov 2014 21:26:33 +0000 (21:26 +0000)]
Fix build break: remove unused variable in FCFI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221710 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoTotally forget deallocated SDNodes in SDDbgInfo.
Frederic Riss [Tue, 11 Nov 2014 21:21:08 +0000 (21:21 +0000)]
Totally forget deallocated SDNodes in SDDbgInfo.

What would happen before that commit is that the SDDbgValues associated with
a deallocated SDNode would be marked Invalidated, but SDDbgInfo would keep
a map entry keyed by the SDNode pointer pointing to this list of invalidated
SDDbgNodes. As the memory gets reused, the list might get wrongly associated
with another new SDNode. As the SDDbgValues are cloned when they are transfered,
this can lead to an exponential number of SDDbgValues being produced during
DAGCombine like in http://llvm.org/bugs/show_bug.cgi?id=20893

Note that the previous behavior wasn't really buggy as the invalidation made
sure that the SDDbgValues won't be used. This commit can be considered a
memory optimization and as such is really hard to validate in a unit-test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221709 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd Forward Control-Flow Integrity.
Tom Roeder [Tue, 11 Nov 2014 21:08:02 +0000 (21:08 +0000)]
Add Forward Control-Flow Integrity.

This commit adds a new pass that can inject checks before indirect calls to
make sure that these calls target known locations. It supports three types of
checks and, at compile time, it can take the name of a custom function to call
when an indirect call check fails. The default failure function ignores the
error and continues.

This pass incidentally moves the function JumpInstrTables::transformType from
private to public and makes it static (with a new argument that specifies the
table type to use); this is so that the CFI code can transform function types
at call sites to determine which jump-instruction table to use for the check at
that site.

Also, this removes support for jumptables in ARM, pending further performance
analysis and discussion.

Review: http://reviews.llvm.org/D4167

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221708 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[llvm-mc] Fixing case where if a file ended with non-newline whitespace or a comma...
Colin LeMahieu [Tue, 11 Nov 2014 21:03:09 +0000 (21:03 +0000)]
[llvm-mc] Fixing case where if a file ended with non-newline whitespace or a comma it would access invalid memory.
Cleaned up parse loop.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221707 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUse rcpss/rcpps (X86) to speed up reciprocal calcs (PR21385).
Sanjay Patel [Tue, 11 Nov 2014 20:51:00 +0000 (20:51 +0000)]
Use rcpss/rcpps (X86) to speed up reciprocal calcs (PR21385).

This is a first step for generating SSE rcp instructions for reciprocal
calcs when fast-math allows it. This is very similar to the rsqrt optimization
enabled in D5658 ( http://reviews.llvm.org/rL220570 ).

For now, be conservative and only enable this for AMD btver2 where performance
improves significantly both in terms of latency and throughput.

We may never enable this codegen for Intel Core* chips because the divider circuits
are just too fast. On SandyBridge, divss can be as fast as 10 cycles versus the 21
cycle critical path for the rcp + mul + sub + mul + add estimate.

Follow-on patches may allow configuration of the number of Newton-Raphson refinement
steps, add AVX512 support, and enable the optimization for more chips.

More background here: http://llvm.org/bugs/show_bug.cgi?id=21385

Differential Revision: http://reviews.llvm.org/D6175

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221706 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSimplify testcase. NFC.
Rafael Espindola [Tue, 11 Nov 2014 20:49:16 +0000 (20:49 +0000)]
Simplify testcase. NFC.

Thanks to Filipe Cabecinhas for the tip.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221705 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[PowerPC] Replace foul hackery with real calls to __tls_get_addr
Bill Schmidt [Tue, 11 Nov 2014 20:44:09 +0000 (20:44 +0000)]
[PowerPC] Replace foul hackery with real calls to __tls_get_addr

My original support for the general dynamic and local dynamic TLS
models contained some fairly obtuse hacks to generate calls to
__tls_get_addr when lowering a TargetGlobalAddress.  Rather than
generating real calls, special GET_TLS_ADDR nodes were used to wrap
the calls and only reveal them at assembly time.  I attempted to
provide correct parameter and return values by chaining CopyToReg and
CopyFromReg nodes onto the GET_TLS_ADDR nodes, but this was also not
fully correct.  Problems were seen with two back-to-back stores to TLS
variables, where the call sequences ended up overlapping with unhappy
results.  Additionally, since these weren't real calls, the proper
register side effects of a call were not recorded, so clobbered values
were kept live across the calls.

The proper thing to do is to lower these into calls in the first
place.  This is relatively straightforward; see the changes to
PPCTargetLowering::LowerGlobalTLSAddress() in PPCISelLowering.cpp.
The changes here are standard call lowering, except that we need to
track the fact that these calls will require a relocation.  This is
done by adding a machine operand flag of MO_TLSLD or MO_TLSGD to the
TargetGlobalAddress operand that appears earlier in the sequence.

The calls to LowerCallTo() eventually find their way to
LowerCall_64SVR4() or LowerCall_32SVR4(), which call FinishCall(),
which calls PrepareCall().  In PrepareCall(), we detect the calls to
__tls_get_addr and immediately snag the TargetGlobalTLSAddress with
the annotated relocation information.  This becomes an extra operand
on the call following the callee, which is expected for nodes of type
tlscall.  We change the call opcode to CALL_TLS for this case.  Back
in FinishCall(), we change it again to CALL_NOP_TLS for 64-bit only,
since we require a TOC-restore nop following the call for the 64-bit
ABIs.

During selection, patterns in PPCInstrInfo.td and PPCInstr64Bit.td
convert the CALL_TLS nodes into BL_TLS nodes, and convert the
CALL_NOP_TLS nodes into BL8_NOP_TLS nodes.  This replaces the code
removed from PPCAsmPrinter.cpp, as the BL_TLS or BL8_NOP_TLS
nodes can now be emitted normally using their patterns and the
associated printTLSCall print method.

Finally, as a result of these changes, all references to get-tls-addr
in its various guises are no longer used, so they have been removed.

There are existing TLS tests to verify the changes haven't messed
anything up).  I've added one new test that verifies that the problem
with the original code has been fixed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221703 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUse a 8 bit immediate when possible.
Rafael Espindola [Tue, 11 Nov 2014 19:46:36 +0000 (19:46 +0000)]
Use a 8 bit immediate when possible.

This fixes pr21529.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221700 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix a warning about ‘r_type’ may be used uninitialized.
Kevin Enderby [Tue, 11 Nov 2014 19:16:45 +0000 (19:16 +0000)]
Fix a warning about ‘r_type’ may be used uninitialized.

Thanks to Aaron Ballman for noticing this!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221696 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86][ELF] Fix PR20243 - leaf frame pointer bug with TLS access
Dario Domizioli [Tue, 11 Nov 2014 18:44:49 +0000 (18:44 +0000)]
[X86][ELF] Fix PR20243 - leaf frame pointer bug with TLS access

The ISel lowering for global TLS access in PIC mode was creating a pseudo
instruction that is later expanded to a call, but the code was not
setting the hasCalls flag in the MachineFrameInfo alongside the adjustsStack
flag. This caused some functions to be mistakenly recognized as leaf functions,
and this in turn affected the decision to eliminate the frame pointer.

With the fix, hasCalls is properly set and the leaf frame pointer is correctly
preserved.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221695 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoLLVM incorrectly folds xor into select
Oliver Stannard [Tue, 11 Nov 2014 17:36:01 +0000 (17:36 +0000)]
LLVM incorrectly folds xor into select

LLVM replaces the SelectionDAG pattern (xor (set_cc cc x y) 1) with
(set_cc !cc x y), which is only correct when the xor has type i1.
Instead, we should check that the constant operand to the xor is all
ones.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221693 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[mips] Add preliminary support for the MIPS II target.
Vasileios Kalintiris [Tue, 11 Nov 2014 11:43:55 +0000 (11:43 +0000)]
[mips] Add preliminary support for the MIPS II target.

Summary:
This patch enables code generation for the MIPS II target. Pre-Mips32
targets don't have the MUL instruction, so we add the correspondent
pattern that uses the MULT/MFLO combination in order to retrieve the
product.

This is WIP as we don't support code generation for select nodes due to
the lack of conditional-move instructions.

Reviewers: dsanders

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6150

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221686 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[mips] Add hardware register name "hwr_ulr" ($29)
Vasileios Kalintiris [Tue, 11 Nov 2014 11:22:39 +0000 (11:22 +0000)]
[mips] Add hardware register name "hwr_ulr" ($29)

The canonical name when printing assembly is still $29. The reason is that
GAS does not accept "$hwr_ulr" at the moment.

This addresses the comments from r221307, which reverted the original
commit r221299.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221685 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86] Add missing check for 'isINSERTPSMask' in method 'isShuffleMaskLegal'.
Andrea Di Biagio [Tue, 11 Nov 2014 11:20:31 +0000 (11:20 +0000)]
[X86] Add missing check for 'isINSERTPSMask' in method 'isShuffleMaskLegal'.

This helps the DAGCombiner to identify more opportunities to fold shuffles.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221684 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRecommit "[mips] Add names and tests for the hardware registers"
Vasileios Kalintiris [Tue, 11 Nov 2014 10:31:31 +0000 (10:31 +0000)]
Recommit "[mips] Add names and tests for the hardware registers"

The original commit r221299 was reverted in r221307.  I removed the name
"hrw_ulr" ($29) from the original commit because two tests were failing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221681 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agollvm-objdump: Skip empty sections when dumping contents
David Majnemer [Tue, 11 Nov 2014 09:58:25 +0000 (09:58 +0000)]
llvm-objdump: Skip empty sections when dumping contents

Empty sections are just noise when using objdump.
This is similar to what binutils does.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221680 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoWas convinced in commit comments that requiring a specific python version is the...
Manuel Klimek [Tue, 11 Nov 2014 08:53:18 +0000 (08:53 +0000)]
Was convinced in commit comments that requiring a specific python version is the wrong approach; reverting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221679 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMC, COFF: Use relocations for function references inside the section
David Majnemer [Tue, 11 Nov 2014 08:43:57 +0000 (08:43 +0000)]
MC, COFF: Use relocations for function references inside the section

Referencing one symbol from another in the same section does not
generally require a relocation.  However, the MS linker has a feature
called /INCREMENTAL which enables incremental links.  It achieves this
by creating thunks to the actual function and redirecting all
relocations to point to the thunk.

This breaks down with the old scheme if you have a function which
references, say, itself.  On x86_64, we would use %rip relative
addressing to reference the start of the function from out current
position.  This would lead to miscompiles because other references might
reference the thunk instead, breaking function pointer equality.

This fixes PR21520.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221678 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[CMake] llvm-shlib: Prune redundant components, AsmPrinter, MC, and SelectionDAG.
NAKAMURA Takumi [Tue, 11 Nov 2014 07:57:25 +0000 (07:57 +0000)]
[CMake] llvm-shlib: Prune redundant components, AsmPrinter, MC, and SelectionDAG.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221675 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAddition to r216371 (SLP and Loop Vectorization) and r218607 where
Suyog Sarda [Tue, 11 Nov 2014 07:39:27 +0000 (07:39 +0000)]
Addition to r216371 (SLP and Loop Vectorization) and r218607 where
cost model for signed division by power of 2 was improved for AArch64.
The revision r218607 missed test case for Loop Vectorization.
Adding it in this revision.

Differential Revision: http://reviews.llvm.org/D6181

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221674 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUse uint64_t as the type for the X86 TSFlag format enum. Allows removal of the VEXShi...
Craig Topper [Tue, 11 Nov 2014 07:32:32 +0000 (07:32 +0000)]
Use uint64_t as the type for the X86 TSFlag format enum. Allows removal of the VEXShift hack that was used to access the higher bits of TSFlags.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221673 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86] Fix pattern match for 32-to-64-bit zext in the presence of AssertSext
Michael Kuperstein [Tue, 11 Nov 2014 07:07:40 +0000 (07:07 +0000)]
[X86] Fix pattern match for 32-to-64-bit zext in the presence of AssertSext

This fixes an issue with matching trunc -> assertsext -> zext on x86-64, which would not zero the high 32-bits. See PR20494 for details.
Recommitting - This time, with a hopefully working test.

Differential Revision: http://reviews.llvm.org/D6128

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221672 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoOnly run the gold plugin tests if gold supports the targets we test with.
Rafael Espindola [Tue, 11 Nov 2014 05:27:12 +0000 (05:27 +0000)]
Only run the gold plugin tests if gold supports the targets we test with.

This fixes pr21345.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221669 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[NVPTX] Remove dead code in NVPTXTargetTransformInfo (NFC)
Jingyue Wu [Tue, 11 Nov 2014 05:24:04 +0000 (05:24 +0000)]
[NVPTX] Remove dead code in NVPTXTargetTransformInfo (NFC)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221668 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMCAsmParserExtension has a copy of the MCAsmParser. Use it.
Rafael Espindola [Tue, 11 Nov 2014 05:18:41 +0000 (05:18 +0000)]
MCAsmParserExtension has a copy of the MCAsmParser. Use it.

Base classes were storing a second copy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221667 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd const. NFC.
Rafael Espindola [Tue, 11 Nov 2014 05:11:47 +0000 (05:11 +0000)]
Add const. NFC.

This adds const to a few methods that already return const references or
creates a const version when they reterun non-const references.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221666 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDon't duplicate names in comments. NFC.
Rafael Espindola [Tue, 11 Nov 2014 04:58:32 +0000 (04:58 +0000)]
Don't duplicate names in comments. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221665 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDon't repeat name in comment. NFC.
Rafael Espindola [Tue, 11 Nov 2014 04:49:14 +0000 (04:49 +0000)]
Don't repeat name in comment. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221664 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86] Custom lower UINT_TO_FP from v4f32 to v4i32, and for v8f32 to v8i32 if
Quentin Colombet [Tue, 11 Nov 2014 02:23:47 +0000 (02:23 +0000)]
[X86] Custom lower UINT_TO_FP from v4f32 to v4i32, and for v8f32 to v8i32 if
AVX2 is available.
According to IACA, the new lowering has a throughput of 8 cycles instead of 13
with the previous one.

Althought this lowering kicks in some SPECs benchmarks, the performance
improvement was within the noise.

Correctness testing has been done for the whole range of uint32_t with the
following program:
    uint4 v = (uint4) {0,1,2,3};
    uint32_t i;

    //Check correctness over entire range for uint4 -> float4 conversion
    for( i = 0; i < 1U << (32-2); i++ )
    {
        float4 t = test(v);
        float4 c = correct(v);

        if( 0xf != _mm_movemask_ps( t == c ))
        {
            printf( "Error @ %vx: %vf vs. %vf\n", v, c, t);
            return -1;
        }

        v += 4;
    }
Where "correct" is the old lowering and "test" the new one.

The patch adds a test case for the two custom lowering instruction.
It also modifies the vector cost model, which is why cast.ll and uitofp.ll are
modified.
2009-02-26-MachineLICMBug.ll is also modified because we now hoist 7
instructions instead of 4 (3 more constant loads).

rdar://problem/18153096>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221657 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agospeling.
Nico Weber [Tue, 11 Nov 2014 01:13:42 +0000 (01:13 +0000)]
speling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221652 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[yaml2obj] Support AArch64 relocations.
Chad Rosier [Mon, 10 Nov 2014 23:02:03 +0000 (23:02 +0000)]
[yaml2obj] Support AArch64 relocations.

Patch by Daniel Stewart <stewartd@codeaurora.org>!
Phabricator Revision: http://reviews.llvm.org/D6192

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221639 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoconfigure.ac lives in autoconf/, not autotools/
Rafael Espindola [Mon, 10 Nov 2014 22:36:04 +0000 (22:36 +0000)]
configure.ac lives in autoconf/, not autotools/

Patch by Palmer Dabbelt!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221638 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoReverting r221626 due to a too-strict test.
Michael Kuperstein [Mon, 10 Nov 2014 21:07:41 +0000 (21:07 +0000)]
Reverting r221626 due to a too-strict test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221629 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[AArch64][FastISel] Fix kill flags for integer extends.
Juergen Ributzka [Mon, 10 Nov 2014 21:05:31 +0000 (21:05 +0000)]
[AArch64][FastISel] Fix kill flags for integer extends.

In the case we optimize an integer extend away and replace it directly with the
source register, we also have to clear all kill flags at all its uses.
This is necessary, because the orignal IR instruction might be trivially dead,
but we replaced it with a nop at MI level.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221628 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[SwitchLowering] Fix the "fixPhis" function.
Juergen Ributzka [Mon, 10 Nov 2014 21:05:27 +0000 (21:05 +0000)]
[SwitchLowering] Fix the "fixPhis" function.

Switch statements may have more than one incoming edge into the same BB if they
all have the same value. When the switch statement is converted these incoming
edges are now coming from multiple BBs. Updating all incoming values to be from
a single BB is incorrect and would generate invalid LLVM IR.

The fix is to only update the first occurrence of an incoming value. Switch
lowering will perform subsequent calls to this helper function for each incoming
edge with a new basic block - updating all edges in the process.

This fixes rdar://problem/18916275.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221627 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86] Fix pattern match for 32-to-64-bit zext in the presence of AssertSext
Michael Kuperstein [Mon, 10 Nov 2014 20:40:21 +0000 (20:40 +0000)]
[X86] Fix pattern match for 32-to-64-bit zext in the presence of AssertSext

This fixes an issue with matching trunc -> assertsext -> zext on x86-64, which would not zero the high 32-bits.
See PR20494 for details.

Differential Revision: http://reviews.llvm.org/D6128

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221626 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoCopy externally_initialized in GlobalVariable::copyAttributesFrom.
Rafael Espindola [Mon, 10 Nov 2014 18:41:59 +0000 (18:41 +0000)]
Copy externally_initialized in GlobalVariable::copyAttributesFrom.

Patch by Kevin Frei!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221620 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[NVPTX] Add an NVPTX-specific TargetTransformInfo
Jingyue Wu [Mon, 10 Nov 2014 18:38:25 +0000 (18:38 +0000)]
[NVPTX] Add an NVPTX-specific TargetTransformInfo

Summary:
It currently only implements hasBranchDivergence, and will be extended
in later diffs.

Split from D6188.

Test Plan: make check-all

Reviewers: jholewinski

Reviewed By: jholewinski

Subscribers: llvm-commits, meheff, eliben, jholewinski

Differential Revision: http://reviews.llvm.org/D6195

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221619 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMisc style fixes. NFC.
Rafael Espindola [Mon, 10 Nov 2014 18:11:10 +0000 (18:11 +0000)]
Misc style fixes. NFC.

This fixes a few cases of:

* Wrong variable name style.
* Lines longer than 80 columns.
* Repeated names in comments.
* clang-format of the above.

This make the next patch a lot easier to read.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221615 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix extra semicolon warning. NFC.
Vasileios Kalintiris [Mon, 10 Nov 2014 17:37:53 +0000 (17:37 +0000)]
Fix extra semicolon warning. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221613 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[mips][microMIPS] Fix issue with delay slot filler and microMIPS
Zoran Jovanovic [Mon, 10 Nov 2014 17:27:56 +0000 (17:27 +0000)]
[mips][microMIPS] Fix issue with delay slot filler and microMIPS
Differential Revision: http://reviews.llvm.org/D6193

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221612 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix variable names and comment style. NFC.
Rafael Espindola [Mon, 10 Nov 2014 16:31:06 +0000 (16:31 +0000)]
Fix variable names and comment style. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221608 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[mips] Fix sret arguments for N32/N64 which were accidentally broken in r221534.
Daniel Sanders [Mon, 10 Nov 2014 15:57:53 +0000 (15:57 +0000)]
[mips] Fix sret arguments for N32/N64 which were accidentally broken in r221534.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221604 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMark test using python as REQUIRES: python27.
Manuel Klimek [Mon, 10 Nov 2014 15:29:29 +0000 (15:29 +0000)]
Mark test using python as REQUIRES: python27.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221598 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[CMake] llvm-c-test: Use libLLVM.so if it is available.
NAKAMURA Takumi [Mon, 10 Nov 2014 15:04:26 +0000 (15:04 +0000)]
[CMake] llvm-c-test: Use libLLVM.so if it is available.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221592 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[CMake] Let llvm-shlib work on Linux with --whole-archive.
NAKAMURA Takumi [Mon, 10 Nov 2014 15:04:02 +0000 (15:04 +0000)]
[CMake] Let llvm-shlib work on Linux with --whole-archive.

FIXME: It should work on not only Linux but elf-targeting gnu ld.

For example if LLVM_DYLIB_COMPONENTS is "BitWriter Support", CMake emits the command line like;

  -Wl,--whole-archive
    lib/libLLVMBitWriter.a
    lib/libLLVMSupport.a *1
  -Wl,--no-whole-archive
  lib/libLLVMCore.a
  lib/libLLVMSupport.a   *2
  -lrt -ldl -ltinfo -lpthread -lm

It works since symbols in LLVMCore is resolved with not *2 but *1.

Unfortunately, --gc-sections is not powerful in this case to prune unused "visibility(default)" entries.

I am still experimenting other way not to rely on --whole-archive.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221591 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[CMake] Move llvm-shlib in prior to other tools.
NAKAMURA Takumi [Mon, 10 Nov 2014 15:03:02 +0000 (15:03 +0000)]
[CMake] Move llvm-shlib in prior to other tools.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221590 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[CMake] llvm-shlib: Add possibly missing BitReader and MCDisassembler for llvm-c.
NAKAMURA Takumi [Sat, 8 Nov 2014 14:12:30 +0000 (14:12 +0000)]
[CMake] llvm-shlib: Add possibly missing BitReader and MCDisassembler for llvm-c.

FYI, 3 modules below are redundant in trunk;

  AsmPrinter
  MC
  SelectionDAG

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221579 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoR600/SI: Fix broken check prefixes in test
Matt Arsenault [Sat, 8 Nov 2014 00:02:57 +0000 (00:02 +0000)]
R600/SI: Fix broken check prefixes in test

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221565 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoTransforms: address some late comments
Saleem Abdulrasool [Sat, 8 Nov 2014 00:00:50 +0000 (00:00 +0000)]
Transforms: address some late comments

We already use the llvm namespace.  Remove the unnecessary prefix.  Use the
StringRef::equals method to compare with C strings rather than instantiating
std::strings.

Addresses late review comments from David Majnemer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221564 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoTransforms: sort source files in build
Saleem Abdulrasool [Sat, 8 Nov 2014 00:00:47 +0000 (00:00 +0000)]
Transforms: sort source files in build

Sort target sources.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221563 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSelectionDAG: Assert if we truncate SDNode's NumOperands or NumValues
David Majnemer [Fri, 7 Nov 2014 22:39:11 +0000 (22:39 +0000)]
SelectionDAG: Assert if we truncate SDNode's NumOperands or NumValues

No functionality change intended, this just stops us early if we created
a bad SDNode.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221560 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Reassociate] Better preserve NSW/NUW flags.
Chad Rosier [Fri, 7 Nov 2014 22:12:57 +0000 (22:12 +0000)]
[Reassociate] Better preserve NSW/NUW flags.
Part of PR12985.

Phabricator Revision: http://reviews.llvm.org/D6172

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221555 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoTransforms: use typedef rather than using aliases
Saleem Abdulrasool [Fri, 7 Nov 2014 22:09:52 +0000 (22:09 +0000)]
Transforms: use typedef rather than using aliases

Visual Studio 2012 apparently does not support using alias declarations.  Use
the more traditional typedef approach.  This should let the Windows buildbots
pass.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221554 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove unused variable.
Rafael Espindola [Fri, 7 Nov 2014 21:33:09 +0000 (21:33 +0000)]
Remove unused variable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221549 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoTransform: add SymbolRewriter pass
Saleem Abdulrasool [Fri, 7 Nov 2014 21:32:08 +0000 (21:32 +0000)]
Transform: add SymbolRewriter pass

This introduces the symbol rewriter. This is an IR->IR transformation that is
implemented as a CodeGenPrepare pass. This allows for the transparent
adjustment of the symbols during compilation.

It provides a clean, simple, elegant solution for symbol inter-positioning. This
technique is often used, such as in the various sanitizers and performance
analysis.

The control of this is via a custom YAML syntax map file that indicates source
to destination mapping, so as to avoid having the compiler to know the exact
details of the source to destination transformations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221548 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix style.
Michael J. Spencer [Fri, 7 Nov 2014 21:30:36 +0000 (21:30 +0000)]
Fix style.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221547 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoR600: Remove unused define
Matt Arsenault [Fri, 7 Nov 2014 20:45:00 +0000 (20:45 +0000)]
R600: Remove unused define

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221543 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDon't redeclare a pure virtual method.
Rafael Espindola [Fri, 7 Nov 2014 18:07:04 +0000 (18:07 +0000)]
Don't redeclare a pure virtual method.

I.E., there is no value is having

void foo() override = 0;

If it is override it is already present in a base class. Since it is pure,
some other class will have to implement it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221537 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUse StringRefMemoryObject in llvm-mc. NFC.
Rafael Espindola [Fri, 7 Nov 2014 17:59:05 +0000 (17:59 +0000)]
Use StringRefMemoryObject in llvm-mc. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221536 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[mips] Promote i32 arguments to i64 for the N32/N64 ABI and fix <64-bit structs...
Daniel Sanders [Fri, 7 Nov 2014 16:54:21 +0000 (16:54 +0000)]
[mips] Promote i32 arguments to i64 for the N32/N64 ABI and fix <64-bit structs...

Summary:
... and after all that refactoring, it's possible to distinguish softfloat
floating point values from integers so this patch no longer breaks softfloat to
do it.

Remove direct handling of i32's in the N32/N64 ABI by promoting them to
i64. This more closely reflects the ABI documentation and also fixes
problems with stack arguments on big-endian targets.

We now rely on signext/zeroext annotations (already generated by clang) and
the Assert[SZ]ext nodes to avoid the introduction of unnecessary sign/zero
extends.

It was not possible to convert three tests to use signext/zeroext. These tests
are bswap.ll, ctlz-v.ll, ctlz-v.ll. It's not possible to put signext on a
vector type so we just accept the sign extends here for now. These tests don't
pass the vectors the same way clang does (clang puts multiple elements in the
same argument, these map 1 element to 1 argument) so we don't need to worry too
much about it.

With this patch, all known N32/N64 bugs should be fixed and we now pass the
first 10,000 tests generated by ABITest.py.

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6117

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221534 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[CMake] LLVMSupport: Give system_libs PRIVATE scope when LLVMSupport is built as...
NAKAMURA Takumi [Fri, 7 Nov 2014 16:08:19 +0000 (16:08 +0000)]
[CMake] LLVMSupport: Give system_libs PRIVATE scope when LLVMSupport is built as SHARED. Users of LLVMSupport won't inherit ${system_libs}.

unittests/SupporTests is another user of libpthreads. Apply LLVM_SYSTEM_LIBS for him explicitly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221531 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoPass PRIVATE to target_link_libraries if using shared libraries.
Rafael Espindola [Fri, 7 Nov 2014 15:33:56 +0000 (15:33 +0000)]
Pass PRIVATE to target_link_libraries if using shared libraries.

A shared library (unlike a .a), has its dependencies recorded in the library and
we can pass PRIVATE to target_link_libraries.

This patch then removes some bogus dependencies when using
BUILD_SHARED_LIBS=ON. For example, we go from

build lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/AggressiveAntiDepBreaker.cpp.o:
CXX_COMPILER /home/espindola/llvm/llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp
|| include/llvm/IR/intrinsics_gen lib/libLLVMSupport.so
lib/libLLVMCore.so lib/libLLVMBitReader.so
lib/libLLVMTransformUtils.so lib/libLLVMInstCombine.so
lib/libLLVMScalarOpts.so lib/libLLVMipa.so lib/libLLVMAnalysis.so
lib/libLLVMMCParser.so lib/libLLVMMC.so lib/libLLVMObject.so
lib/libLLVMTarget.so lib/libLLVMProfileData.so

to

build lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/AggressiveAntiDepBreaker.cpp.o:
CXX_COMPILER /home/espindola/llvm/llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp
|| include/llvm/IR/intrinsics_gen lib/libLLVMSupport.so
lib/libLLVMCore.so lib/libLLVMTransformUtils.so
lib/libLLVMScalarOpts.so lib/libLLVMAnalysis.so lib/libLLVMMC.so
lib/libLLVMTarget.so

In fact, build.ninja goes from 5231028 bytes to 4896759 bytes.

With this, old verisons of bfd ld (2.24 is OK, 2.23 warns) will print a bogus
warning when building with BUILD_SHARED_LIBS.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221530 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[mips] Removed the remainder of MipsCC. NFC.
Daniel Sanders [Fri, 7 Nov 2014 15:33:08 +0000 (15:33 +0000)]
[mips] Removed the remainder of MipsCC. NFC.

Summary:
One of the calls to AllocateStack (the one in LowerCall) doesn't look like
it should be there but it was there before and removing it breaks the
frame size calculation.

Reviewers: vmedic, theraven

Reviewed By: theraven

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6116

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221529 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[mips] Remove MipsCC::reservedArgArea() in favour of MipsABIInfo::GetCalleeAllocdArgS...
Daniel Sanders [Fri, 7 Nov 2014 15:03:53 +0000 (15:03 +0000)]
[mips] Remove MipsCC::reservedArgArea() in favour of MipsABIInfo::GetCalleeAllocdArgSizeInBytes(). NFC.

Summary:

Reviewers: theraven, vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6115

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221528 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMipsCCState.h: Use LLVM_DELETED_FUNCTION for msc17.
NAKAMURA Takumi [Fri, 7 Nov 2014 14:56:31 +0000 (14:56 +0000)]
MipsCCState.h: Use LLVM_DELETED_FUNCTION for msc17.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221527 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agollvm/test/tools/llvm-symbolizer/ppc64.test: Avoid subshell.
NAKAMURA Takumi [Fri, 7 Nov 2014 14:50:10 +0000 (14:50 +0000)]
llvm/test/tools/llvm-symbolizer/ppc64.test: Avoid subshell.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221526 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[mips] Move MipsCCState to a separate file and clang-formatted it.
Daniel Sanders [Fri, 7 Nov 2014 14:24:31 +0000 (14:24 +0000)]
[mips] Move MipsCCState to a separate file and clang-formatted it.

Summary: Depends on D6113

Reviewers: theraven, vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6114

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221525 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[mips] Fix unused variable warnings introduced in r221521
Daniel Sanders [Fri, 7 Nov 2014 12:43:01 +0000 (12:43 +0000)]
[mips] Fix unused variable warnings introduced in r221521

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221522 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[mips] Remove remaining use of MipsCC::intArgRegs() in favour of MipsABIInfo::GetByVa...
Daniel Sanders [Fri, 7 Nov 2014 12:21:37 +0000 (12:21 +0000)]
[mips] Remove remaining use of MipsCC::intArgRegs() in favour of MipsABIInfo::GetByValArgRegs() and MipsABIInfo::GetVarArgRegs()

Summary: Depends on D6112

Reviewers: theraven, vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6113

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221521 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[mips] Remove MipsCC::getRegVT(). NFC
Daniel Sanders [Fri, 7 Nov 2014 12:02:59 +0000 (12:02 +0000)]
[mips] Remove MipsCC::getRegVT(). NFC

Summary: It's no longer used.

Reviewers: vmedic, theraven

Reviewed By: theraven

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6112

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221519 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[mips] Remove MipsCC::analyzeCallOperands in favour of CCState::AnalyzeCallOperands...
Daniel Sanders [Fri, 7 Nov 2014 11:43:49 +0000 (11:43 +0000)]
[mips] Remove MipsCC::analyzeCallOperands in favour of CCState::AnalyzeCallOperands. NFC

Summary:
In addition to the usual f128 workaround, it was also necessary to provide
a means of accessing ArgListEntry::IsFixed.

Reviewers: theraven, vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6111

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221518 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[mips] Move SpecialCallingConv to MipsCCState and use it from tablegen-erated code...
Daniel Sanders [Fri, 7 Nov 2014 11:10:48 +0000 (11:10 +0000)]
[mips] Move SpecialCallingConv to MipsCCState and use it from tablegen-erated code. NFC

Summary:
In the long run, it should probably become a calling convention in its own
right but for now just move it out of
MipsISelLowering::analyzeCallOperands() so that we can drop this function
in favour of CCState::AnalyzeCallOperands().

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6085

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221517 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[mips] Removed IsVarArg from MipsISelLowering::analyzeCallOperands(). NFC.
Daniel Sanders [Fri, 7 Nov 2014 10:45:16 +0000 (10:45 +0000)]
[mips] Removed IsVarArg from MipsISelLowering::analyzeCallOperands(). NFC.

Summary:
CCState objects already carry this information in their isVarArg() method.

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6084

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221516 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agollvm-symbolizer: teach it about PowerPC64 ELF function descriptors
Jay Foad [Fri, 7 Nov 2014 09:08:39 +0000 (09:08 +0000)]
llvm-symbolizer: teach it about PowerPC64 ELF function descriptors

Summary:
Teach llvm-symbolizer about PowerPC64 ELF function descriptors. Symbols in the .opd section point to function descriptors, the first word of which is a pointer to the real function. For the purposes of symbolizing we pretend that the symbol points directly to the function.

This is enough to get decent function names in stack traces for unoptimized binaries, which fixes the sanitizer print-stack-trace test on PowerPC64 Linux.

Reviewers: kcc, willschm, samsonov

Reviewed By: samsonov

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6110

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221514 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSCCP: overdefined calls cannot become constant
David Majnemer [Fri, 7 Nov 2014 08:54:19 +0000 (08:54 +0000)]
SCCP: overdefined calls cannot become constant

We would attempt to fold away a call instruction which had been marked
overdefined.  However, it's not valid to transition to constant from
overdefined.

This fixes PR21512.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221513 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd Position-independent Code model Module API.
Justin Hibbits [Fri, 7 Nov 2014 04:46:10 +0000 (04:46 +0000)]
Add Position-independent Code model Module API.

Summary:
This makes PIC levels a Module flag attribute, which can be queried by the
backend.  The flag is named `PIC Level`, and can have a value of:

  0 - Backend-default
  1 - Small-model (-fpic)
  2 - Large-model (-fPIC)

These match the `-pic-level' command line argument for clang, and the value of the
preprocessor macro `__PIC__'.

Test Plan:
New flags tests specific for the 'PIC Level' module flag.
Tests to be added as part of a future commit for PowerPC, which will use this new API.

Reviewers: rafael, echristo

Reviewed By: rafael, echristo

Subscribers: rafael, llvm-commits

Differential Revision: http://reviews.llvm.org/D5882

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221510 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[AArch64] Keep flags on condition vreg when instantiating a CB branch.
Ahmed Bougacha [Fri, 7 Nov 2014 02:50:00 +0000 (02:50 +0000)]
[AArch64] Keep flags on condition vreg when instantiating a CB branch.

Reversing a CB* instruction used to drop the flags on the condition. On the
included testcase, this lead to a read from an undefined vreg.
Using addOperand keeps the flags, here <undef>.

Differential Revision: http://reviews.llvm.org/D6159

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221507 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUse a StringRefMemoryObject. NFC.
Rafael Espindola [Fri, 7 Nov 2014 01:09:51 +0000 (01:09 +0000)]
Use a StringRefMemoryObject. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221503 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUse StringRefMemoryObject. NFC.
Rafael Espindola [Fri, 7 Nov 2014 00:52:15 +0000 (00:52 +0000)]
Use StringRefMemoryObject. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221502 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoLoopVectorize: Don't assume pointees are sized
David Majnemer [Fri, 7 Nov 2014 00:31:14 +0000 (00:31 +0000)]
LoopVectorize: Don't assume pointees are sized

A pointer's pointee might not be sized: the pointee could be a function.

Report this as IK_NoInduction when calculating isInductionVariable.

This fixes PR21508.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221501 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoInstCombine: Rely on cmpxchg's return code when it's strong
David Majnemer [Thu, 6 Nov 2014 23:23:30 +0000 (23:23 +0000)]
InstCombine: Rely on cmpxchg's return code when it's strong

Comparing the result of a cmpxchg instruction can be replaced with an
extractvalue of the cmpxchg success indicator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221498 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove unused variable. NFC.
Rafael Espindola [Thu, 6 Nov 2014 23:16:57 +0000 (23:16 +0000)]
Remove unused variable. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221497 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDon't repeat names in comments. NFC.
Rafael Espindola [Thu, 6 Nov 2014 22:57:10 +0000 (22:57 +0000)]
Don't repeat names in comments. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221495 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[ELF][yaml2obj] Handle additional MIPS specific st_other field flags
Simon Atanasyan [Thu, 6 Nov 2014 22:46:24 +0000 (22:46 +0000)]
[ELF][yaml2obj] Handle additional MIPS specific st_other field flags

The ELF symbol `st_other` field might contain additional flags besides
visibility ones. This patch implements support for some MIPS specific
flags.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221491 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFactor out call to push_back. NFC.
Rafael Espindola [Thu, 6 Nov 2014 22:39:16 +0000 (22:39 +0000)]
Factor out call to push_back. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221490 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86][SSE] Vector integer/float conversion memory folding (cvttps2dq / cvttpd2dq)
Simon Pilgrim [Thu, 6 Nov 2014 22:15:41 +0000 (22:15 +0000)]
[X86][SSE] Vector integer/float conversion memory folding (cvttps2dq / cvttpd2dq)

Fixed an issue with the (v)cvttps2dq and (v)cvttpd2dq instructions being incorrectly put in the 2 source operand folding tables instead of the 1 source operand and added the missing SSE/AVX versions.

Also added missing (v)cvtps2dq and (v)cvtpd2dq instructions to the folding tables.

Differential Revision: http://reviews.llvm.org/D6001

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221489 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86] Add VFMADDSUB cases for the 213->231 custom inserter.
Ahmed Bougacha [Thu, 6 Nov 2014 22:04:15 +0000 (22:04 +0000)]
[X86] Add VFMADDSUB cases for the 213->231 custom inserter.

Also add tests for vfmadd/vfmsub.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221488 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86] Add missing FMA3 VFMADDSUB in the emitter.
Ahmed Bougacha [Thu, 6 Nov 2014 21:58:11 +0000 (21:58 +0000)]
[X86] Add missing FMA3 VFMADDSUB in the emitter.

Also reuse the fma4 intrinsic test to cover fma3 instructions too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221487 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoObject, COFF: Don't consider AuxFunctionDefinition for getSymbolSize
David Majnemer [Thu, 6 Nov 2014 21:46:55 +0000 (21:46 +0000)]
Object, COFF: Don't consider AuxFunctionDefinition for getSymbolSize

mingw lies about the size of a function's AuxFunctionDefinition.  Ignore
the field and rely on our heuristic to determine the symbol's size.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221485 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86] Split FMA4 RM tests into a separate file. NFC.
Ahmed Bougacha [Thu, 6 Nov 2014 21:46:23 +0000 (21:46 +0000)]
[X86] Split FMA4 RM tests into a separate file. NFC.

While there, remove useless comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221484 91177308-0d34-0410-b5e6-96231b3b80d8