OSDN Git Service
Rafael Espindola [Mon, 21 Mar 2016 21:09:38 +0000 (21:09 +0000)]
Add a testcase that would have found the bug in r263971.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263988
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 21 Mar 2016 20:59:15 +0000 (20:59 +0000)]
Revert "[llvm-objdump] Printing relocations in executable and shared object files. This partially reverts r215844 by removing test objdump-reloc-shared.test which stated GNU objdump doesn't print relocations, it does."
This reverts commit r263971.
It produces the wrong results for .rela.dyn. I will add a test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263987
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Mon, 21 Mar 2016 20:55:59 +0000 (20:55 +0000)]
Unxfail test/DebugInfo/Generic/multiline.ll on Hexagon
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263986
91177308-0d34-0410-b5e6-
96231b3b80d8
Nicolai Haehnle [Mon, 21 Mar 2016 20:39:24 +0000 (20:39 +0000)]
AMDGPU: Coding style fixes
I meant to add these before committing r263982 as per the review,
but I forgot to squash.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263983
91177308-0d34-0410-b5e6-
96231b3b80d8
Nicolai Haehnle [Mon, 21 Mar 2016 20:28:33 +0000 (20:28 +0000)]
AMDGPU: Add SIWholeQuadMode pass
Summary:
Whole quad mode is already enabled for pixel shaders that compute
derivatives, but it must be suspended for instructions that cause a
shader to have side effects (i.e. stores and atomics).
This pass addresses the issue by storing the real (initial) live mask
in a register, masking EXEC before instructions that require exact
execution and (re-)enabling WQM where required.
This pass is run before register coalescing so that we can use
machine SSA for analysis.
The changes in this patch expose a problem with the second machine
scheduling pass: target independent instructions like COPY implicitly
use EXEC when they operate on VGPRs, but this fact is not encoded in
the MIR. This can lead to miscompilation because instructions are
moved past changes to EXEC.
This patch fixes the problem by adding use-implicit operands to
target independent instructions. Some general codegen passes are
relaxed to work with such implicit use operands.
Reviewers: arsenm, tstellarAMD, mareko
Subscribers: MatzeB, arsenm, llvm-commits
Differential Revision: http://reviews.llvm.org/D18162
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263982
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Mon, 21 Mar 2016 20:27:17 +0000 (20:27 +0000)]
[Hexagon] Add handling fixups and instruction relaxation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263981
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Mon, 21 Mar 2016 20:13:33 +0000 (20:13 +0000)]
[Hexagon] Properly encode registers in duplex instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263980
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Mon, 21 Mar 2016 19:57:08 +0000 (19:57 +0000)]
[Hexagon] Fix reserving emergency spill slots for register scavenger
- R10 and R11 are not reserved registers.
- Check for reserved registers when finding unused caller-saved registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263977
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Mon, 21 Mar 2016 19:54:41 +0000 (19:54 +0000)]
[WebAssembly] Implement the eqz instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263976
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Mon, 21 Mar 2016 19:47:44 +0000 (19:47 +0000)]
[SLP] Remove unnecessary member variables by using container APIs.
This changes the debug output, but still retains its usefulness.
Differential Revision: http://reviews.llvm.org/D18324
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263975
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Mon, 21 Mar 2016 19:14:50 +0000 (19:14 +0000)]
[llvm-objdump] Printing relocations in executable and shared object files. This partially reverts r215844 by removing test objdump-reloc-shared.test which stated GNU objdump doesn't print relocations, it does.
In executable and shared object ELF files, relocations in the file contain the final virtual address rather than section offset so this is adjusted to display section offset.
Differential revision: http://reviews.llvm.org/D15965
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263971
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Mon, 21 Mar 2016 18:56:58 +0000 (18:56 +0000)]
AMDGPU/SI: Fix threshold calculation for branching when exec is zero
Summary:
When control flow is implemented using the exec mask, the compiler will
insert branch instructions to skip over the masked section when exec is
zero if the section contains more than a certain number of instructions.
The previous code would only count instructions in successor blocks,
and this patch modifies the code to start counting instructions in all
blocks between the start and end of the branch.
Reviewers: nhaehnle, arsenm
Subscribers: arsenm, llvm-commits
Differential Revision: http://reviews.llvm.org/D18282
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263969
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Mon, 21 Mar 2016 18:04:10 +0000 (18:04 +0000)]
[AArch64] Add a helpful assert. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263965
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Mon, 21 Mar 2016 18:02:18 +0000 (18:02 +0000)]
AMDGPU: Remove SignBitIsZero for mubuf scratch offsets
These instructions do not have the same negative base
address problem that DS instructions do on SI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263964
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Mon, 21 Mar 2016 18:00:02 +0000 (18:00 +0000)]
ARM: Better codegen for 64-bit compares.
This introduces a custom lowering for ISD::SETCCE (introduced in r253572)
that allows us to emit a short code sequence for 64-bit compares.
Before:
push {r7, lr}
cmp r0, r2
mov.w r0, #0
mov.w r12, #0
it hs
movhs r0, #1
cmp r1, r3
it ge
movge.w r12, #1
it eq
moveq r12, r0
cmp.w r12, #0
bne .LBB1_2
@ BB#1: @ %bb1
bl f
pop {r7, pc}
.LBB1_2: @ %bb2
bl g
pop {r7, pc}
After:
push {r7, lr}
subs r0, r0, r2
sbcs.w r0, r1, r3
bge .LBB1_2
@ BB#1: @ %bb1
bl f
pop {r7, pc}
.LBB1_2: @ %bb2
bl g
pop {r7, pc}
Saves around 80KB in Chromium's libchrome.so.
Some notes on this patch:
- I don't much like the ARMISD::BRCOND and ARMISD::CMOV combines I
introduced (nothing else needs them). However, they are necessary in
order to avoid poor codegen, and they seem similar to existing combines
in other backends (e.g. X86 combines (brcond (cmp (setcc Compare))) to
(brcond Compare)).
- No support for Thumb-1. This is in principle possible, but we'd need
to implement ARMISD::SUBE for Thumb-1.
Differential Revision: http://reviews.llvm.org/D15256
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263962
91177308-0d34-0410-b5e6-
96231b3b80d8
Renato Golin [Mon, 21 Mar 2016 17:29:01 +0000 (17:29 +0000)]
[ARM] Add Cortex-A32 support
Adding Cortex-A32 as an available target in the ARM backend.
Patch by Sam Parker.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263956
91177308-0d34-0410-b5e6-
96231b3b80d8
Hemant Kulkarni [Mon, 21 Mar 2016 17:18:23 +0000 (17:18 +0000)]
[llvm-readobj] Impl GNU style symbols printing
Implements "readelf -sW and readelf -DsW"
Differential Revision: http://reviews.llvm.org/D18224
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263952
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Mon, 21 Mar 2016 16:56:25 +0000 (16:56 +0000)]
[Orc] Switch RPC Procedure to take a function type, rather than an arg list.
No functional change, just a little more readable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263951
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Mon, 21 Mar 2016 16:49:16 +0000 (16:49 +0000)]
APFloat: Add frexp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263950
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Mon, 21 Mar 2016 16:11:05 +0000 (16:11 +0000)]
AMDGPU: Add frexp_mant intrinsic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263948
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Mon, 21 Mar 2016 15:00:35 +0000 (15:00 +0000)]
Implement constant folding for bitreverse
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263945
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Mon, 21 Mar 2016 13:43:58 +0000 (13:43 +0000)]
[AArch64] Fix a -Wdocumentation warning. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263942
91177308-0d34-0410-b5e6-
96231b3b80d8
Silviu Baranga [Mon, 21 Mar 2016 12:44:29 +0000 (12:44 +0000)]
[IndVars] Fix PR26974: make sure replaceCongruentIVs doesn't break LCSSA
Summary:
replaceCongruentIVs can break LCSSA when trying to replace IV increments
since it tries to replace all uses of a phi node with another phi node
while both of the phi nodes are not necessarily in the processed loop.
This will cause an assert in IndVars.
To fix this, we add a check to make sure that the replacement maintains
LCSSA.
Reviewers: sanjoy
Subscribers: mzolotukhin, llvm-commits
Differential Revision: http://reviews.llvm.org/D18266
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263941
91177308-0d34-0410-b5e6-
96231b3b80d8
Silviu Baranga [Mon, 21 Mar 2016 11:43:46 +0000 (11:43 +0000)]
[DAGCombine] Catch the case where extract_vector_elt can cause an any_ext while processing AND SDNodes
Summary:
extract_vector_elt can cause an implicit any_ext if the types don't
match. When processing the following pattern:
(and (extract_vector_elt (load ([non_ext|any_ext|zero_ext] V))), c)
DAGCombine was ignoring the possible extend, and sometimes removing
the AND even though it was required to maintain some of the bits
in the result to 0, resulting in a miscompile.
This change fixes the issue by limiting the transformation only to
cases where the extract_vector_elt doesn't perform the implicit
extend.
Reviewers: t.p.northover, jmolloy
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D18247
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263935
91177308-0d34-0410-b5e6-
96231b3b80d8
Elena Demikhovsky [Mon, 21 Mar 2016 11:06:20 +0000 (11:06 +0000)]
Fixed -mcpu flag
"core-avx" does not exist; I changed to "nehalem"
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263932
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 20 Mar 2016 21:46:58 +0000 (21:46 +0000)]
[X86][SSE] Add vector integer division by constant tests
Expanded tests and split into sdiv/srem and udiv/urem cases for 128 and 256 bit vectors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263917
91177308-0d34-0410-b5e6-
96231b3b80d8
Jingyue Wu [Sun, 20 Mar 2016 20:59:20 +0000 (20:59 +0000)]
[NVPTX] Adds a new address space inference pass.
Summary:
The old address space inference pass (NVPTXFavorNonGenericAddrSpaces) is unable
to convert the address space of a pointer induction variable. This patch adds a
new pass called NVPTXInferAddressSpaces that overcomes that limitation using a
fixed-point data-flow analysis (see the file header comments for details).
The new pass is experimental and not enabled by default. Users can turn
it on by setting the -nvptx-use-infer-addrspace flag of llc.
Reviewers: jholewinski, tra, jlebar
Subscribers: jholewinski, llvm-commits
Differential Revision: http://reviews.llvm.org/D17965
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263916
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Sun, 20 Mar 2016 20:12:33 +0000 (20:12 +0000)]
[gold] Emit a diagnostic in case we fail to remove a file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263914
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 20 Mar 2016 17:43:07 +0000 (17:43 +0000)]
[X86][SSE] Tidyup setTargetShuffleZeroElements to match computeZeroableShuffleElements
Based on feedback for D14261
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263911
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 20 Mar 2016 15:45:42 +0000 (15:45 +0000)]
[X86][SSE] Detect zeroable shuffle elements from different value types
Improve computeZeroableShuffleElements to be able to peek through bitcasts to extract zero/undef values from BUILD_VECTOR nodes of different element sizes to the shuffle mask.
Differential Revision: http://reviews.llvm.org/D14261
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263906
91177308-0d34-0410-b5e6-
96231b3b80d8
Igor Breger [Sun, 20 Mar 2016 13:09:43 +0000 (13:09 +0000)]
AVX512BW: Enable v32i1/v64i1 BUILD_VECTOR
Differential Revision: http://reviews.llvm.org/D18211
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263898
91177308-0d34-0410-b5e6-
96231b3b80d8
George Rimar [Sun, 20 Mar 2016 09:45:08 +0000 (09:45 +0000)]
[ELF] Update x86_64 relocations to 0.99.8 ABI
Added: R_X86_64_GOTPCRELX, R_X86_64_REX_GOTPCRELX
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263894
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 20 Mar 2016 01:17:54 +0000 (01:17 +0000)]
Suppress a -Wunused-variable warning in release builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263892
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kuperstein [Sun, 20 Mar 2016 00:16:13 +0000 (00:16 +0000)]
Use a range-based for loop. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263889
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Sat, 19 Mar 2016 21:28:28 +0000 (21:28 +0000)]
Expose IRBuilder::CreateAtomicCmpXchg as LLVMBuildAtomicCmpXchg in the C API.
Summary: Also expose getters and setters in the C API, so that the change can be tested.
Reviewers: nhaehnle, axw, joker.eph
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D18260
From: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263886
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Sat, 19 Mar 2016 21:28:18 +0000 (21:28 +0000)]
Const-correctness in libLTO
Looks like I was sloppy when bridging to C.
Thanks D. Blaikie for noticing!
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263885
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Sat, 19 Mar 2016 16:35:32 +0000 (16:35 +0000)]
CodeGen: use range based for loop
Convert a loop to use a range based style loop. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263884
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Sat, 19 Mar 2016 04:53:02 +0000 (04:53 +0000)]
[SimplifyLibCalls] Only consider sinpi/cospi functions within the same function
The sinpi/cospi can be replaced with sincospi to remove unnecessary
computations. However, we need to make sure that the calls are within
the same function!
This fixes PR26993.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263875
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Sat, 19 Mar 2016 04:39:52 +0000 (04:39 +0000)]
[InstCombine] Don't insert instructions before a catch switch
CatchSwitches are not splittable, we cannot insert casts, etc. before
them.
This fixes PR26992.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263874
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Sat, 19 Mar 2016 03:12:54 +0000 (03:12 +0000)]
Add a dependency from llvm-link to TransformUtils following r263860
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263873
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Sat, 19 Mar 2016 02:34:33 +0000 (02:34 +0000)]
[gold] Use early return to simplify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263872
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sat, 19 Mar 2016 02:05:33 +0000 (02:05 +0000)]
Removed trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263871
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Sat, 19 Mar 2016 01:24:23 +0000 (01:24 +0000)]
Fix a const_cast related warning in GCC in the C API for libLTO
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263870
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Sat, 19 Mar 2016 01:06:24 +0000 (01:06 +0000)]
Add a comment on partial hashing of Metadata
Following r263866, on D. Blaikie suggestion.
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263869
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Sat, 19 Mar 2016 01:05:33 +0000 (01:05 +0000)]
[libFuzzer] one more trophie
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263868
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Sat, 19 Mar 2016 01:02:34 +0000 (01:02 +0000)]
Hash Metadata using pointer for MDString argument instead of value (NFC)
MDString are uniqued in the Context on creation, hashing the
pointer is less expensive than hashing the String itself.
Reviewers: dexonsmith
Differential Revision: http://reviews.llvm.org/D16560
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263867
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Sat, 19 Mar 2016 00:59:26 +0000 (00:59 +0000)]
Compute some Debug Info Metadata hash key partially (NFC)
Summary:
This patch changes the computation of the hash key for DISubprogram to
be computed on a small subset of the fields. The hash is computed a
lot faster, but there might be more collision in the table.
However by carefully selecting the fields, colisions should be rare.
Using `opt` to load the IR for FastISelEmitter.cpp.o, with this patch:
- DISubprogram::getImpl() goes from 28ms to 15ms.
- DICompositeType::getImpl() goes from 6ms to 2ms
- DIDerivedType::getImpl() goes from 18 to 12ms
Reviewers: dexonsmith
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D16571
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263866
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Sat, 19 Mar 2016 00:40:31 +0000 (00:40 +0000)]
Rework linkInModule(), making it oblivious to ThinLTO
Summary:
ThinLTO is relying on linkInModule to import selected function.
However a lot of "magic" was hidden in linkInModule and the IRMover,
who would rename and promote global variables on the fly.
This is moving to an approach where the steps are decoupled and the
client is reponsible to specify the list of globals to import.
As a consequence some test are changed because they were relying on
the previous behavior which was importing the definition of *every*
single global without control on the client side.
Now the burden is on the client to decide if a global has to be imported
or not.
Reviewers: tejohnson
Subscribers: joker.eph, llvm-commits
Differential Revision: http://reviews.llvm.org/D18122
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263863
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Sat, 19 Mar 2016 00:17:32 +0000 (00:17 +0000)]
Add a test for r263577: "Add missing error handling in llvm-lto"
On Rafael's suggestion!
(also fix a discrepancy between this error message format and the others)
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263860
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Fri, 18 Mar 2016 23:44:37 +0000 (23:44 +0000)]
[CXX_FAST_TLS] Fix issues in ARM.
We need to be careful on which registers can be explicitly handled
via copies. Prologue, Epilogue use physical registers and if one belongs
to the set of CSRsViaCopy, it will no longer be CSRed, since PEI overwrites
it after the explicit copies.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263857
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Fri, 18 Mar 2016 23:41:51 +0000 (23:41 +0000)]
[CXX_FAST_TLS] Disable tail call when calling conventions are mismatched.
Since CXX_FAST_TLS has a bigger set of CSRs, we don't tail call when caller
and callee have mismatched calling conventions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263856
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Fri, 18 Mar 2016 23:38:49 +0000 (23:38 +0000)]
[CXX_FAST_TLS] fix issues with O0 on ARM, AArch64 and X86.
Since at O0, explicit copies via SplitCSR may not be removed even if
they are unnecessary, we choose not to use SplitCSR at O0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263855
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 18 Mar 2016 23:30:54 +0000 (23:30 +0000)]
AArch64: Don't modify other modules in AArch64PromoteConstant
Avoid modifying other modules in `AArch64PromoteConstant` when the
constant is `ConstantData` (a horrible accident, I'm sure, caught by an
experimental follow-up to r261464).
Previously, this walked through all the users of a constant, but that
reaches into other modules when the constant doesn't depend transitively
on a `GlobalValue`! Since we're walking instructions anyway, just
modify the instructions we actually see.
As a drive-by, instead of storing `Use` and getting the instructions
again via `Use::getUser()` (which is not a constantant time lookup),
store `std::pair<Instruction, unsigned>`. Besides being cheaper, this
makes it easier to drop use-lists form `ConstantData` in the future.
(I threw this in because I was touching all the code anyway.)
Because the patch completely changes the traversal logic, it looks
like a rewrite of the pass, but the core logic is all the same (or
should be, minus the out-of-module changes). In other words, there
should be NFC as long as the LLVMContext only has a single Module.
I didn't think of a good way to test this, but I hope to submit a patch
eventually that makes walking these use-lists illegal/impossible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263853
91177308-0d34-0410-b5e6-
96231b3b80d8
Mike Aizatsky [Fri, 18 Mar 2016 23:29:29 +0000 (23:29 +0000)]
[sancov] clang-formatting SanitizerCoverage.cpp and fully pleasing clang-tidy.
Differential Revision: http://reviews.llvm.org/D18288
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263852
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kuperstein [Fri, 18 Mar 2016 23:19:29 +0000 (23:19 +0000)]
Have DataLayout::isLegalInteger() accept uint64_t
While not strictly necessary, since we don't support large integer
types, this avoids bugs due to silent truncation from uint64_t to a
32-bit unsigned (e.g. DL.isLegalInteger(DL.getTypeSizeInBits(Ty) )
This fixes PR26972.
Differential Revision: http://reviews.llvm.org/D18258
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263850
91177308-0d34-0410-b5e6-
96231b3b80d8
Mike Aizatsky [Fri, 18 Mar 2016 22:46:10 +0000 (22:46 +0000)]
[sancov] typo fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263849
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Fri, 18 Mar 2016 22:44:16 +0000 (22:44 +0000)]
[Support] Update comment to match actual behavior.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263848
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 18 Mar 2016 22:43:42 +0000 (22:43 +0000)]
Revert "Revert "[sancov] specifying sanitizer coverage dependencies.""
This reverts commit r263825, re-instating r263797.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263847
91177308-0d34-0410-b5e6-
96231b3b80d8
Mike Aizatsky [Fri, 18 Mar 2016 22:40:52 +0000 (22:40 +0000)]
[sancov] reformat & 1 clang-tidy warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263846
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 18 Mar 2016 22:35:58 +0000 (22:35 +0000)]
[sancov] Fix the sancov pass to initialize itself inside its
constructor. This should fix the recent crashes on certain
architectures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263845
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Fri, 18 Mar 2016 22:11:51 +0000 (22:11 +0000)]
Fixing autocorrect changing cmake->make
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263843
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexei Starovoitov [Fri, 18 Mar 2016 22:02:47 +0000 (22:02 +0000)]
BPF: emit an error message for unsupported signed division operation
Signed-off-by: Yonghong Song <yhs@plumgrid.com>
Signed-off-by: Alexei Starovoitov <ast@fb.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263842
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Fri, 18 Mar 2016 21:59:33 +0000 (21:59 +0000)]
Missed a few non-ascii characters
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263841
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Fri, 18 Mar 2016 21:57:51 +0000 (21:57 +0000)]
Updates based on post-commit review of r263834
* Renamed to be camel case, consistent with other docs.
* Fixed non-ascii characters (this is what I get for writing docs on an iPad).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263840
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Fri, 18 Mar 2016 21:51:14 +0000 (21:51 +0000)]
[obj2yaml, COFF] Assert that the alignment is not bogus
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263839
91177308-0d34-0410-b5e6-
96231b3b80d8
Easwaran Raman [Fri, 18 Mar 2016 21:29:30 +0000 (21:29 +0000)]
Interface to get/set profile summary metadata to module
Differential Revision: http://reviews.llvm.org/D17894
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263835
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Fri, 18 Mar 2016 21:16:26 +0000 (21:16 +0000)]
[Docs] New documentation for advanced build configurations
This document covers how to use some of the new complex build configurations CMake supports.
Feedback and improvements welcomed!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263834
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Fri, 18 Mar 2016 20:58:29 +0000 (20:58 +0000)]
[libFuzzer] add a flag close_fd_mask so that we can silence spammy targets by closing stderr/stdout
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263831
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Fri, 18 Mar 2016 20:41:11 +0000 (20:41 +0000)]
MILexer: Add ErrorCallbackType typedef; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263829
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Fri, 18 Mar 2016 20:37:11 +0000 (20:37 +0000)]
[IndVars] Make the fix for PR26973 more obvious; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263828
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Fri, 18 Mar 2016 20:37:07 +0000 (20:37 +0000)]
[IndVars] Pass the right loop to isLoopInvariantPredicate
The loop on IVOperand's incoming values assumes IVOperand to be an
induction variable on the loop over which `S Pred X` is invariant;
otherwise loop invariant incoming values to IVOperand are not guaranteed
to dominate the comparision.
This fixes PR26973.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263827
91177308-0d34-0410-b5e6-
96231b3b80d8
Mike Aizatsky [Fri, 18 Mar 2016 20:34:58 +0000 (20:34 +0000)]
Revert "[sancov] specifying sanitizer coverage dependencies."
This fails on arm.
This reverts commit
52c8e0f7119d1ea1050c0708565a8c92b73386d2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263825
91177308-0d34-0410-b5e6-
96231b3b80d8
Nicolai Haehnle [Fri, 18 Mar 2016 20:32:04 +0000 (20:32 +0000)]
AMDGPU: add missing braces around multi-line if block
This fixes an issue with rL263658 pointed out by Tom Stellard.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263823
91177308-0d34-0410-b5e6-
96231b3b80d8
Mike Spertus [Fri, 18 Mar 2016 20:06:16 +0000 (20:06 +0000)]
Typesafe visualization of PointerIntPairs in Visual Studio
In the <DisplayString> of PointerIntPair , I cast the pointer to the actual type, so VS can leverage it while visualizing, not unlike the recent change to PointerUnion visualization.
In the expansion, the current code is casting to the incorrect type (wrong number of stars), so I fixed that as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263821
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Fri, 18 Mar 2016 19:21:02 +0000 (19:21 +0000)]
[AArch64] Enable more load clustering in the MI Scheduler.
This patch adds unscaled loads and sign-extend loads to the TII
getMemOpBaseRegImmOfs API, which is used to control clustering in the MI
scheduler. This is done to create more opportunities for load pairing. I've
also added the scaled LDRSWui instruction, which was missing from the scaled
instructions. Finally, I've added support in shouldClusterLoads for clustering
adjacent sext and zext loads that too can be paired by the load/store optimizer.
Differential Revision: http://reviews.llvm.org/D18048
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263819
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Fri, 18 Mar 2016 18:54:32 +0000 (18:54 +0000)]
[codeview] Only emit function ids for inlined functions
We aren't referencing any other kind of function currently.
Should save a bit on our debug info size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263817
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Fri, 18 Mar 2016 18:22:07 +0000 (18:22 +0000)]
[MCParser] Accept uppercase radix variants 0X and 0B
Differential Revision: http://reviews.llvm.org/D14781
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263802
91177308-0d34-0410-b5e6-
96231b3b80d8
Mike Aizatsky [Fri, 18 Mar 2016 17:33:21 +0000 (17:33 +0000)]
[sancov] specifying sanitizer coverage dependencies.
Summary:
These dependencies would be used in the future to reduce the number
of instrumented blocks(http://reviews.llvm.org/rL262103)
This is submitted as a separate CL because of previous problems with
ARM.
Subscribers: aemerson
Differential Revision: http://reviews.llvm.org/D18227
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263797
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Fri, 18 Mar 2016 16:26:48 +0000 (16:26 +0000)]
[llvm-objdump] Print <unknown> in place of instruction text if it couldn't be disassembled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263793
91177308-0d34-0410-b5e6-
96231b3b80d8
Nicolai Haehnle [Fri, 18 Mar 2016 16:24:40 +0000 (16:24 +0000)]
AMDGPU: Overload return type of llvm.amdgcn.buffer.load.format
Summary:
Allow the selection of BUFFER_LOAD_FORMAT_x and _XY. Do this now before
the frontend patches land in Mesa. Eventually, we may want to automatically
reduce the size of loads at the LLVM IR level, which requires such overloads,
and in some cases Mesa can generate them directly.
Reviewers: tstellarAMD, arsenm
Subscribers: arsenm, llvm-commits
Differential Revision: http://reviews.llvm.org/D18255
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263792
91177308-0d34-0410-b5e6-
96231b3b80d8
Nicolai Haehnle [Fri, 18 Mar 2016 16:24:31 +0000 (16:24 +0000)]
AMDGPU/SI: Add llvm.amdgcn.buffer.atomic.* intrinsics
Summary:
These intrinsics expose the BUFFER_ATOMIC_* instructions and will be used
by Mesa to implement atomics with buffer semantics. The intrinsic interface
matches that of buffer.load.format and buffer.store.format, except that the
GLC bit is not exposed (it is automatically deduced based on whether the
return value is used).
The change of hasSideEffects is required for TableGen to accept the pattern
that matches the intrinsic.
Reviewers: tstellarAMD, arsenm
Subscribers: arsenm, rivanvx, llvm-commits
Differential Revision: http://reviews.llvm.org/D18151
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263791
91177308-0d34-0410-b5e6-
96231b3b80d8
Nicolai Haehnle [Fri, 18 Mar 2016 16:24:20 +0000 (16:24 +0000)]
AMDGPU: use ComplexPattern for offsets in llvm.amdgcn.buffer.load/store.format
Summary:
We cannot easily deduce that an offset is in an SGPR, but the Mesa frontend
cannot easily make use of an explicit soffset parameter either. Furthermore,
it is likely that in the future, LLVM will be in a better position than the
frontend to choose an SGPR offset if possible.
Since there aren't any frontend uses of these intrinsics in upstream
repositories yet, I would like to take this opportunity to change the
intrinsic signatures to a single offset parameter, which is then selected
to immediate offsets or voffsets using a ComplexPattern.
Reviewers: arsenm, tstellarAMD, mareko
Subscribers: arsenm, llvm-commits
Differential Revision: http://reviews.llvm.org/D18218
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263790
91177308-0d34-0410-b5e6-
96231b3b80d8
Sam Kolton [Fri, 18 Mar 2016 15:35:51 +0000 (15:35 +0000)]
[AMDGPU] Assembler: Change dpp_ctrl syntax to match sp3
Review: http://reviews.llvm.org/D18267
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263789
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 18 Mar 2016 14:19:19 +0000 (14:19 +0000)]
[Fuzzer] Guard no_sanitize_memory attributes behind __has_feature.
Otherwise GCC fails to build it because it doesn't know the attribute.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263787
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Fri, 18 Mar 2016 14:08:42 +0000 (14:08 +0000)]
Fix some typos; NFC
Patch by Dongyuan Liu.
Differential Revision: http://reviews.llvm.org/D17977
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263786
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Atanasyan [Fri, 18 Mar 2016 09:52:12 +0000 (09:52 +0000)]
[llvm-objdump] Move test case to the X86 sub-directory because it depends on X86 target supporting. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263781
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Fri, 18 Mar 2016 05:04:04 +0000 (05:04 +0000)]
Always cache resolved paths as it even saves on StringMap lookups.
Now that the resolved path cache stores the StringRef's, its
best to just always cache the results, even when realpath isn't
used. This way we'll still avoid the StringMap hashing and lookup.
This also conveniently reorganises this code in a way I need for
a future patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263777
91177308-0d34-0410-b5e6-
96231b3b80d8
Ehsan Amiri [Fri, 18 Mar 2016 04:02:25 +0000 (04:02 +0000)]
adding another optimization opportunity to readme file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263775
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Fri, 18 Mar 2016 03:48:09 +0000 (03:48 +0000)]
Use StringRef's in resolved path cache to avoid extra internString lookups. NFC.
ResolvedPaths was storing std::string's as a cache. We would then take those strings and look them up in the internString pool to get a unique StringRef for each path.
This patch changes ResolvedPaths to store the StringRef pointing in to the internString pool itself. This way, when getResolvedPath returns a string, we know we have the StringRef we would find in the pool anyway. We can avoid the duplicate memory of the std::string's, and also the time from the lookup.
Unfortunately my profiles show no runtime change here, but it should still save memory allocations which is nice.
Reviewed by Frederic Riss.
Differential Revision: http://reviews.llvm.org/D18259
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263774
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Fri, 18 Mar 2016 01:36:00 +0000 (01:36 +0000)]
[libFuzzer] read corpus dirs recursively
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263773
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Fri, 18 Mar 2016 00:27:43 +0000 (00:27 +0000)]
[LoopDataPrefetch] Add TTI to limit the number of iterations to prefetch ahead
Summary:
It can hurt performance to prefetch ahead too much. Be conservative for
now and don't prefetch ahead more than 3 iterations on Cyclone.
Reviewers: hfinkel
Subscribers: llvm-commits, mzolotukhin
Differential Revision: http://reviews.llvm.org/D17949
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263772
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Fri, 18 Mar 2016 00:27:38 +0000 (00:27 +0000)]
[LoopDataPrefetch/Aarch64] Allow selective prefetching of large-strided accesses
Summary:
And use this TTI for Cyclone. As it was explained in the original RFC
(http://thread.gmane.org/gmane.comp.compilers.llvm.devel/92758), the HW
prefetcher work up to 2KB strides.
I am also adding tests for this and the previous change (D17943):
* Cyclone prefetching accesses with a large stride
* Cyclone not prefetching accesses with a small stride
* Generic Aarch64 subtarget not prefetching either
Reviewers: hfinkel
Subscribers: aemerson, rengolin, llvm-commits, mzolotukhin
Differential Revision: http://reviews.llvm.org/D17945
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263771
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Fri, 18 Mar 2016 00:27:29 +0000 (00:27 +0000)]
[Aarch64] Add pass LoopDataPrefetch for Cyclone
Summary:
This wires up the pass for Cyclone but keeps it off for now because we
need a few more TTIs.
The getPrefetchMinStride value is not very well tuned right now but it
works well with CFP2006/433.milc which motivated this.
Tests will be added as part of the upcoming large-stride prefetching
patch.
Reviewers: t.p.northover
Subscribers: llvm-commits, aemerson, hfinkel, rengolin
Differential Revision: http://reviews.llvm.org/D17943
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263770
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Fri, 18 Mar 2016 00:23:29 +0000 (00:23 +0000)]
[libFuzzer] improve -merge functionality
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263769
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Fri, 18 Mar 2016 00:12:37 +0000 (00:12 +0000)]
[Support] Refactor Error unit tests to avoid duplicating work.
Suggested by Dave Blaikie in review for r263749. Thanks Dave!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263768
91177308-0d34-0410-b5e6-
96231b3b80d8
Mike Aizatsky [Fri, 18 Mar 2016 00:12:14 +0000 (00:12 +0000)]
[sancov] html report: replacing uncovered functions with function coverage % table.
Differential Revision: http://reviews.llvm.org/D18256
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263767
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Thu, 17 Mar 2016 23:58:03 +0000 (23:58 +0000)]
DebugInfo: Add ability to not emit DW_AT_vtable_elem_location for virtual functions.
A virtual index of -1u indicates that the subprogram's virtual index is
unrepresentable (for example, when using the relative vtable ABI), so do
not emit a DW_AT_vtable_elem_location attribute for it.
Differential Revision: http://reviews.llvm.org/D18236
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263765
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Thu, 17 Mar 2016 23:43:33 +0000 (23:43 +0000)]
[Support] Address some of dblaikie's feedback for r263749.
Fixes some missing std::moves and take Expected<T> by rvalue reference in the
call operator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263764
91177308-0d34-0410-b5e6-
96231b3b80d8
Mike Aizatsky [Thu, 17 Mar 2016 23:32:20 +0000 (23:32 +0000)]
Revert "allow lambdas in mapped_iterator"
MSVC as usual:
C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\include\llvm/ADT/STLExtras.h(120):
error C2100: illegal indirection
C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\include\llvm/IR/Instructions.h(3966):
note: see reference to class template instantiation
'llvm::mapped_iterator<llvm::User::op_iterator,llvm::CatchSwitchInst::DerefFnTy>'
being compiled
This reverts commit
e091dd63f1f34e043748e28ad160d3bc17731168.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263760
91177308-0d34-0410-b5e6-
96231b3b80d8
Mike Aizatsky [Thu, 17 Mar 2016 23:22:22 +0000 (23:22 +0000)]
allow lambdas in mapped_iterator
Differential Revision: http://reviews.llvm.org/D17311
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263759
91177308-0d34-0410-b5e6-
96231b3b80d8