OSDN Git Service
Eli Friedman [Fri, 11 Aug 2017 21:12:04 +0000 (21:12 +0000)]
[OptDiag] Updating Remarks in SampleProfile
Updating remark API to newer OptimizationDiagnosticInfo API. This
allows remarks to show up in diagnostic yaml file, and enables use
of opt-viewer tool.
Hotness information for remarks (L505 and L751) do not display hotness
information, most likely due to profile information not being
propagated yet. Unsure if this is the desired outcome.
Patch by Tarun Rajendran.
Differential Revision: https://reviews.llvm.org/D36127
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310763
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 11 Aug 2017 20:55:29 +0000 (20:55 +0000)]
[X86] Don't use fsin/fcos/fsincos instructions ever
Summary:
Previously we would use these instructions if sse was disabled and fastmath was enabled.
As mentioned in D28335, this is a bad idea.
Reviewers: efriedma, scanon, DavidKreitzer
Reviewed By: DavidKreitzer
Subscribers: zvi, llvm-commits
Differential Revision: https://reviews.llvm.org/D36344
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310762
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 11 Aug 2017 20:49:27 +0000 (20:49 +0000)]
Fix access to undefined weak symbols in pic code
When the access to a weak symbol is not a call, the access has to be
able to produce the value 0 at runtime.
We were sometimes producing code sequences where that was not possible
if the code was leaded more than 4g away from 0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310756
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Fri, 11 Aug 2017 20:46:28 +0000 (20:46 +0000)]
Output S_SECTION symbols to the Linker module.
PDBs need to contain 1 module for each object file/compiland,
and a special one synthesized by the linker. This one contains
a symbol record for each output section in the executable with
its address information. This patch adds such symbols to the
linker module. Note that we also are supposed to add an
S_COFFGROUP symbol for what appears to be each input section that
contributes to each output section, but it's not entirely clear
how to generate these yet, so I'm leaving that for a separate
patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310754
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 11 Aug 2017 20:42:08 +0000 (20:42 +0000)]
AMDGPU: Start adding tail call support
Handle the sibling call cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310753
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Fri, 11 Aug 2017 20:32:47 +0000 (20:32 +0000)]
[libFuzzer] recommend Clang Coverage for coverage visualization
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310751
91177308-0d34-0410-b5e6-
96231b3b80d8
George Karpenkov [Fri, 11 Aug 2017 20:30:52 +0000 (20:30 +0000)]
[libFuzzer] Re-enable coverage.test on Darwin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310750
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Fri, 11 Aug 2017 19:19:21 +0000 (19:19 +0000)]
Revert r310716 (and r310735): [globalisel][tablegen] Support zero-instruction emission.
Two of the Windows bots are failing test\CodeGen\X86\GlobalISel\select-inc.mir
which should not have been affected by the change. Reverting while I investigate.
Also reverted r310735 because it builds on r310716.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310745
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Fri, 11 Aug 2017 19:00:22 +0000 (19:00 +0000)]
Add documentation for llvm-pdbutil.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310744
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Fri, 11 Aug 2017 19:00:03 +0000 (19:00 +0000)]
[LLD/PDB] Write actual records to the globals stream.
Previously we were writing an empty globals stream. Windows
tools interpret this as "private symbols are not present in
this PDB", even when they are, so we need to fix this. Regardless,
without it we don't have information about global variables, so
we need to fix it anyway. This patch does that.
With this patch, the "lm" command in WinDbg correctly reports
that we have private symbols available, but the "dv" command
still refuses to display local variables.
Differential Revision: https://reviews.llvm.org/D36535
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310743
91177308-0d34-0410-b5e6-
96231b3b80d8
John Baldwin [Fri, 11 Aug 2017 18:35:19 +0000 (18:35 +0000)]
[mips] clang-format MipsSubtarget.cpp.
This only fixes a few things and serves as my initial test commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310742
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gesiak [Fri, 11 Aug 2017 18:05:26 +0000 (18:05 +0000)]
[opt-viewer] Decode HTML bytes for Python 3
Summary:
When using Python 3, `pygments.highlight()` returns a `bytes` object, not
a `str`, causing the call to `str.replace` on the following line to fail
with a runtime exception:
`TypeError: 'str' does not support the buffer interface`. Decode the
bytes into a string in order to fix the exception.
Test Plan:
Run `opt-viewer.py` with Python 3.4, and confirm no runtime error occurs
when calling `str.replace`.
Reviewers: anemet
Reviewed By: anemet
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D36624
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310741
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gesiak [Fri, 11 Aug 2017 18:02:07 +0000 (18:02 +0000)]
[opt-viewer] Use Python 3-compatible iteritems
Summary:
Replace a usage of a Python 2-specific `dict.iteritems()` with the
Python 3-compatible definition provided at the top of the same file.
Test Plan:
Run `opt-viewer.py` using Python 3 and confirm it no longer encounters a
runtime error when calling `dict.iteritems()`.
Reviewers: anemet
Reviewed By: anemet
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D36623
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310740
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gesiak [Fri, 11 Aug 2017 17:56:57 +0000 (17:56 +0000)]
[opt-viewer] Use Python 3-compatible `intern()`
Summary:
In Python 2, `intern()` is a builtin function available to all programs.
In Python 3, it was moved into the `sys` module, available as
`sys.intern`. Import it such that, within `optrecord.py`, `intern()` is
available whether run using Python 2 or 3.
Test Plan:
Run `opt-viewer.py` using Python 3, confirm it no longer
encounters a runtime error when `intern()` is called.
Reviewers: anemet
Reviewed By: anemet
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D36622
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310739
91177308-0d34-0410-b5e6-
96231b3b80d8
Stanislav Mekhanoshin [Fri, 11 Aug 2017 17:54:43 +0000 (17:54 +0000)]
[AMDGPU] Fix santizer error after last commit
Removed useless assert.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310738
91177308-0d34-0410-b5e6-
96231b3b80d8
Xinliang David Li [Fri, 11 Aug 2017 17:49:20 +0000 (17:49 +0000)]
Fix typo /NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310737
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Fri, 11 Aug 2017 17:30:37 +0000 (17:30 +0000)]
[globalisel][tablegen] Generate TypeObject table. NFC
Summary:
Generate the type table from the types used by a target rather than hard-coding
the union of types used by all targets.
Depends on D36084
Reviewers: ab, t.p.northover, qcolombet, rovka, aditya_nandakumar
Reviewed By: rovka
Subscribers: kristof.beyls, igorb, llvm-commits
Differential Revision: https://reviews.llvm.org/D36085
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310735
91177308-0d34-0410-b5e6-
96231b3b80d8
George Karpenkov [Fri, 11 Aug 2017 17:23:45 +0000 (17:23 +0000)]
Update libFuzzer documentation for -fsanitize=fuzzer-no-link flag
Differential Revision: https://reviews.llvm.org/D36602
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310734
91177308-0d34-0410-b5e6-
96231b3b80d8
Stanislav Mekhanoshin [Fri, 11 Aug 2017 16:42:09 +0000 (16:42 +0000)]
[AMDGPU] Ported and adopted AMDLibCalls pass
The pass does simplifications of well known AMD library calls.
If given -amdgpu-prelink option it works in a pre-link mode which
allows to reference new library functions which will be linked in
later.
In addition it also used to process traditional AMD option
-fuse-native which allows to replace some of the functions with
their fast native implementations from the library.
The necessary glue to pass the prelink option and translate
-fuse-native is to be added to the driver.
Differential Revision: https://reviews.llvm.org/D36436
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310731
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 11 Aug 2017 16:38:28 +0000 (16:38 +0000)]
Orc: PR33769: Don't rely on comparisons with default constructed iterators
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310729
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 11 Aug 2017 16:22:45 +0000 (16:22 +0000)]
[AVX512] Remove and autoupgrade many of the broadcast intrinsics
Summary:
This autoupgrades most of the broadcast intrinsics. They've been unused in clang for some time.
This leaves the 32x2 intrinsics because they are still used in clang.
Reviewers: RKSimon, zvi, igorb
Reviewed By: RKSimon
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D36606
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310725
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 11 Aug 2017 16:20:05 +0000 (16:20 +0000)]
[x86] Enable some support for lowerVectorShuffleWithUndefHalf with AVX-512
Summary:
This teaches 512-bit shuffles to detect unused halfs in order to reduce shuffle size.
We may need to refine the 512-bit exit point. I couldn't remember if we had good cross lane shuffles for 8/16 bit with AVX-512 or not.
I believe this is step towards being able to handle D36454 without a special case.
From here we need to improve our ability to combine extract_subvector with insert_subvector and other extract_subvectors. And we need to support narrowing binary operations where we don't demand all elements. This may be improvements to DAGCombiner::narrowExtractedVectorBinOp(by recognizing an insert_subvector in addition to concat) or we may need a target specific combiner.
Reviewers: RKSimon, zvi, delena, jbhateja
Reviewed By: RKSimon, jbhateja
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D36601
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310724
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 11 Aug 2017 15:44:14 +0000 (15:44 +0000)]
[x86] use more shift or LEA for select-of-constants (2nd try)
The previous rev (r310208) failed to account for overflow when subtracting the
constants to see if they're suitable for shift/lea. This version add a check
for that and more test were added in r310490.
We can convert any select-of-constants to math ops:
http://rise4fun.com/Alive/d7d
For this patch, I'm enhancing an existing x86 transform that uses fake multiplies
(they always become shl/lea) to avoid cmov or branching. The current code misses
cases where we have a negative constant and a positive constant, so this is just
trying to plug that hole.
The DAGCombiner diff prevents us from hitting a terrible inefficiency: we can start
with a select in IR, create a select DAG node, convert it into a sext, convert it
back into a select, and then lower it to sext machine code.
Some notes about the test diffs:
1. 2010-08-04-MaskedSignedCompare.ll - We were creating control flow that didn't exist in the IR.
2. memcmp.ll - Choose -1 or 1 is the case that got me looking at this again. We could avoid the
push/pop in some cases if we used 'movzbl %al' instead of an xor on a different reg? That's a
post-DAG problem though.
3. mul-constant-result.ll - The trade-off between sbb+not vs. setne+neg could be addressed if
that's a regression, but those would always be nearly equivalent.
4. pr22338.ll and sext-i1.ll - These tests have undef operands, so we don't actually care about these diffs.
5. sbb.ll - This shows a win for what is likely a common case: choose -1 or 0.
6. select.ll - There's another borderline case here: cmp+sbb+or vs. test+set+lea? Also, sbb+not vs. setae+neg shows up again.
7. select_const.ll - These are motivating cases for the enhancement; replace cmov with cheaper ops.
Assembly differences between movzbl and xor to avoid a partial reg stall are caused later by the X86 Fixup SetCC pass.
Differential Revision: https://reviews.llvm.org/D35340
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310717
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Fri, 11 Aug 2017 15:40:32 +0000 (15:40 +0000)]
[globalisel][tablegen] Support zero-instruction emission.
Summary:
Support the case where an operand of a pattern is also the whole of the
result pattern. In this case the original result and all its uses must be
replaced by the operand. However, register class restrictions can require
a COPY. This patch handles both cases by always emitting the copy and
leaving it for the register allocator to optimize.
Depends on D35833
Reviewers: ab, t.p.northover, qcolombet, rovka, aditya_nandakumar
Subscribers: javed.absar, kristof.beyls, igorb, llvm-commits
Differential Revision: https://reviews.llvm.org/D36084
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310716
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Dardis [Fri, 11 Aug 2017 14:36:05 +0000 (14:36 +0000)]
[mips] Lift the assertion on the types that can be used with MipsGPRel
Post commit review of rL308619 highlighted the need for handling N64
with -fno-pic. Testing reveale a stale assert when generating a GP
relative addressing mode.
This patch removes that assert and adds the necessary patterns for
MIPS64 to perform gp relative addressing with -fno-pic
(and the implicit -mno-abicalls + -mgpopt).
Reviewers: atanasyan, nitesh.jain
Differential Revision: https://reviews.llvm.org/D36472
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310713
91177308-0d34-0410-b5e6-
96231b3b80d8
Michal Gorny [Fri, 11 Aug 2017 13:25:20 +0000 (13:25 +0000)]
[cmake] Expose the dependencies of ExecutionEngine as PUBLIC
Expose the dependencies of LLVMExecutionEngine library as PUBLIC rather
than PRIVATE when building a shared library. This is necessary because
the library is not contained but exposes API of other LLVM libraries via
its headers.
This causes other libraries to fail to link if the linker verifies for
correctness of -l flags (i.e. fails on indirect dependencies). This e.g.
happens when building LLDB against shared LLVM:
lib64/liblldbExpression.a(IRExecutionUnit.cpp.o):(.data.rel.ro._ZTIN4llvm18MCJITMemoryManagerE[_ZTIN4llvm18MCJITMemoryManagerE]+0x10): undefined reference to `typeinfo for llvm::RuntimeDyld::MemoryManager'
lib64/liblldbExpression.a(IRExecutionUnit.cpp.o):(.data.rel.ro._ZTVN4llvm18MCJITMemoryManagerE[_ZTVN4llvm18MCJITMemoryManagerE]+0x60): undefined reference to `llvm::RuntimeDyld::MemoryManager::anchor()'
lib64/liblldbExpression.a(IRExecutionUnit.cpp.o):(.data.rel.ro._ZTVN12lldb_private15IRExecutionUnit13MemoryManagerE[_ZTVN12lldb_private15IRExecutionUnit13MemoryManagerE]+0x48): undefined reference to `llvm::RTDyldMemoryManager::deregisterEHFrames()'
lib64/liblldbExpression.a(IRExecutionUnit.cpp.o):(.data.rel.ro._ZTVN12lldb_private15IRExecutionUnit13MemoryManagerE[_ZTVN12lldb_private15IRExecutionUnit13MemoryManagerE]+0x60): undefined reference to `llvm::RuntimeDyld::MemoryManager::anchor()'
lib64/liblldbExpression.a(IRExecutionUnit.cpp.o):(.data.rel.ro._ZTVN12lldb_private15IRExecutionUnit13MemoryManagerE[_ZTVN12lldb_private15IRExecutionUnit13MemoryManagerE]+0xd0): undefined reference to `llvm::JITSymbolResolver::anchor()'
collect2: error: ld returned 1 exit status
Declaring the dependencies as PUBLIC guarantees that any package using
the ExecutionEngine library will also get explicit -l flags for
the dependent libraries guaranteeing that the symbols exposed in headers
could be resolved.
Patch originally written by NAKAMURA Takumi.
Differential Revision: https://reviews.llvm.org/D36211
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310712
91177308-0d34-0410-b5e6-
96231b3b80d8
Nirav Dave [Fri, 11 Aug 2017 13:21:41 +0000 (13:21 +0000)]
Improve handling of insert_subvector of bitcast values
Fix insert_subvector / extract_subvector merges of bitcast values.
Reviewers: efriedma, craig.topper, RKSimon
Subscribers: RKSimon, llvm-commits
Differential Revision: https://reviews.llvm.org/D34571
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310711
91177308-0d34-0410-b5e6-
96231b3b80d8
Nirav Dave [Fri, 11 Aug 2017 13:21:35 +0000 (13:21 +0000)]
[X86][DAG] Switch X86 Target to post-legalized store merge
Move store merge to happen after intrinsic lowering to allow lowered
stores to be merged.
Some regressions due in MergeConsecutiveStores to missing
insert_subvector that are addressed in follow up patch.
Reviewers: craig.topper, efriedma, RKSimon
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D34559
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310710
91177308-0d34-0410-b5e6-
96231b3b80d8
Sam Parker [Fri, 11 Aug 2017 13:14:00 +0000 (13:14 +0000)]
[AArch64] Enable ARMv8.3-A pointer authentication
Add assembler and disassembler support for the ARMv8.3-A pointer
authentication instructions.
Differential Revision: https://reviews.llvm.org/D36517
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310709
91177308-0d34-0410-b5e6-
96231b3b80d8
Sjoerd Meijer [Fri, 11 Aug 2017 13:12:49 +0000 (13:12 +0000)]
[AArch64] Remove dotprod from base extension list
Dot product is an optional ARMv8.2a extension; remove it from the ARMv8.2a base
extension list. This was introduced in commit r310480.
Differential Revision: https://reviews.llvm.org/D36609
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310708
91177308-0d34-0410-b5e6-
96231b3b80d8
Sjoerd Meijer [Fri, 11 Aug 2017 09:52:30 +0000 (09:52 +0000)]
[ARM] Assembler support for the ARMv8.2a dot product instructions
Commit r310480 added the AArch64 ARMv8.2a dot product instructions;
this adds the AArch32 instructions.
Differential Revision: https://reviews.llvm.org/D36575
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310701
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Fri, 11 Aug 2017 08:37:00 +0000 (08:37 +0000)]
[DAGCombiner] Remove shuffle support from simplifyShuffleMask
rL310372 enabled simplifyShuffleMask to support undef shuffle mask inputs, but its causing hangs.
Removing support until I can triage the problem
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310699
91177308-0d34-0410-b5e6-
96231b3b80d8
Mikael Holmen [Fri, 11 Aug 2017 06:57:08 +0000 (06:57 +0000)]
[IfConversion] Maintain the CFG when predicating/merging blocks in IfConvert*
Summary:
This fixes PR32721 in IfConvertTriangle and possible similar problems in
IfConvertSimple, IfConvertDiamond and IfConvertForkedDiamond.
In PR32721 we had a triangle
EBB
| \
| |
| TBB
| /
FBB
where FBB didn't have any successors at all since it ended with an
unconditional return. Then TBB and FBB were be merged into EBB, but EBB
would still keep its successors, and the use of analyzeBranch and
CorrectExtraCFGEdges wouldn't help to remove them since the return
instruction is not analyzable (at least not on ARM).
The edge updating code and branch probability updating code is now pushed
into MergeBlocks() which allows us to share the same update logic between
more callsites. This lets us remove several dependencies on analyzeBranch
and completely eliminate RemoveExtraEdges.
One thing that showed up with this patch was that IfConversion sometimes
left a successor with 0% probability even if there was no branch or
fallthrough to the successor.
One such example from the test case ifcvt_bad_zero_prob_succ.mir. The
indirect branch tBRIND can only jump to bb.1, but without the patch we
got:
bb.0:
successors: %bb.1(0x80000000)
bb.1:
successors: %bb.1(0x80000000), %bb.2(0x00000000)
tBRIND %r1, 1, %cpsr
B %bb.1
bb.2:
There is no way to jump from bb.1 to bb2, but still there is a 0% edge
from bb.1 to bb.2.
With the patch applied we instead get the expected:
bb.0:
successors: %bb.1(0x80000000)
bb.1:
successors: %bb.1(0x80000000)
tBRIND %r1, 1, %cpsr
B %bb.1
Since bb.2 had no predecessor at all, it was removed.
Several testcases had to be updated due to this since the removed
successor made the "Branch Probability Basic Block Placement" pass
sometimes place blocks in a different order.
Finally added a couple of new test cases:
* PR32721_ifcvt_triangle_unanalyzable.mir:
Regression test for the original problem dexcribed in PR 32721.
* ifcvt_triangleWoCvtToNextEdge.mir:
Regression test for problem that caused a revert of my first attempt
to solve PR 32721.
* ifcvt_simple_bad_zero_prob_succ.mir:
Test case showing the problem where a wrong successor with 0% probability
was previously left.
* ifcvt_[diamond|forked_diamond|simple]_unanalyzable.mir
Very simple test cases for the simple and (forked) diamond cases
involving unanalyzable branches that can be nice to have as a base if
wanting to write more complicated tests.
Reviewers: iteratee, MatzeB, grosser, kparzysz
Reviewed By: kparzysz
Subscribers: kbarton, davide, aemerson, nemanjai, javed.absar, kristof.beyls, llvm-commits
Differential Revision: https://reviews.llvm.org/D34099
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310697
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 11 Aug 2017 05:47:13 +0000 (05:47 +0000)]
[PM] Switch the CGSCC debug messages to use the standard LLVM debug
printing techniques with a DEBUG_TYPE controlling them.
It was a mistake to start re-purposing the pass manager `DebugLogging`
variable for generic debug printing -- those logs are intended to be
very minimal and primarily used for testing. More detailed and
comprehensive logging doesn't make sense there (it would only make for
brittle tests).
Moreover, we kept forgetting to propagate the `DebugLogging` variable to
various places making it also ineffective and/or unavailable. Switching
to `DEBUG_TYPE` makes this a non-issue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310695
91177308-0d34-0410-b5e6-
96231b3b80d8
Jessica Paquette [Thu, 10 Aug 2017 23:11:24 +0000 (23:11 +0000)]
[MachineOutliner] Add RegState::Define to LDRXpost in insertOutlinedCall
This fixes a MachineVerifier failure in machine-outliner.mir. Not explicitly
adding RegState::Define to the LR argument makes it unhappy because an explicit
definition is marked as a use.
Build failure:
http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-expensive/7496/testReport/junit/LLVM/CodeGen_AArch64/machine_outliner_mir/
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310671
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Thu, 10 Aug 2017 21:23:00 +0000 (21:23 +0000)]
Revert "[AsmParser] Hash is not a comment on some targets"
This reverts commit r310457.
It causes clang-produced IR to fail llvm codegen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310662
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 10 Aug 2017 21:14:07 +0000 (21:14 +0000)]
Disable some IR death tests when SEH is available
They hang for me locally. I suspect that there is a use-after-free when
attempting to destroy an LLVMContext after asserting from the middle of
metadata tracking. It doesn't seem worth debugging it further.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310660
91177308-0d34-0410-b5e6-
96231b3b80d8
Nirav Dave [Thu, 10 Aug 2017 21:03:36 +0000 (21:03 +0000)]
Revert "[DAG] Cleanup unused nodes after store merge. NFCI."
This reverts commit r310648 which causes an unexpected assertion failure
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310659
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 10 Aug 2017 20:35:34 +0000 (20:35 +0000)]
[InstCombine] Make (X|C1)^C2 -> X^(C1^C2) iff X&~C1 == 0 work for splat vectors
This also corrects the description to match what was actually implemented. The old comment said X^(C1|C2), but it implemented X^((C1|C2)&~(C1&C2)). I believe ((C1|C2)&~(C1&C2)) is equivalent to (C1^C2).
Differential Revision: https://reviews.llvm.org/D36505
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310658
91177308-0d34-0410-b5e6-
96231b3b80d8
Nirav Dave [Thu, 10 Aug 2017 19:52:45 +0000 (19:52 +0000)]
[DAG] Relax type restriction for store merge
Summary: Allow stores of bitcastable types to be merged by peeking through BITCAST nodes and recasting stored values constant and vector extract nodes as necessary.
Reviewers: jyknight, hfinkel, efriedma, RKSimon, spatel
Reviewed By: RKSimon
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D34569
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310655
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 10 Aug 2017 19:32:35 +0000 (19:32 +0000)]
[CostModel][X86] Add SSE2 two-src shuffle costs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310654
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Thu, 10 Aug 2017 19:31:27 +0000 (19:31 +0000)]
[ARM] Clarify legal addressing modes for ARM and Thumb2. NFC
The existing code is very clever, but not clear, which seems
like the wrong tradeoff here.
Differential Revision: https://reviews.llvm.org/D36559
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310653
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Thu, 10 Aug 2017 19:28:00 +0000 (19:28 +0000)]
[gold-plugin] Use more StringRef. No functionality change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310652
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 10 Aug 2017 19:02:51 +0000 (19:02 +0000)]
[CostModel][X86] Add avx1 two-src shuffle costs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310650
91177308-0d34-0410-b5e6-
96231b3b80d8
Nirav Dave [Thu, 10 Aug 2017 18:53:14 +0000 (18:53 +0000)]
[DAG] Cleanup unused nodes after store merge. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310648
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 10 Aug 2017 18:29:34 +0000 (18:29 +0000)]
[CostModel][X86] Add avx2 two-src shuffle costs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310645
91177308-0d34-0410-b5e6-
96231b3b80d8
Taewook Oh [Thu, 10 Aug 2017 18:17:11 +0000 (18:17 +0000)]
Make .file directive to have basename only
Summary:
Currently LLVM puts directory along with the filename in .file directive, but this behavior doesn't match gcc. There's a no clear description about which one is right (https://sourceware.org/binutils/docs/as/File.html#File), but one document (https://sourceware.org/gdb/current/onlinedocs/stabs/ELF-Linker-Relocation.html) suggests that STT_FILE symbol in elf file is expected to have basename only, which should have a same sting file .file directive according to (https://docs.oracle.com/cd/E26502_01/html/E28388/eoiyg.html).
This also affects badly on the build system that uses hashing, as the directory info could be differnt from developer to developer even when they're working on same file.
Reviewers: pcc, mehdi_amini
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D36018
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310642
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 10 Aug 2017 18:02:45 +0000 (18:02 +0000)]
[CostModel][X86] Extend two src shuffle cost tests
Cover most 128/256/512/1024-bit cases for vXf64/vXi64, vXf32/vXi32, vXi16 + vXi8
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310641
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 10 Aug 2017 17:48:14 +0000 (17:48 +0000)]
[InstCombine] Fix a crash in getSelectCondition if we happen to have two inverse vectors of i1 constants.
We used to try to truncate the constant vector to vXi1, but if it's already i1 this would fail. Instead we now use IRBuilder::getZExtOrTrunc which should check the type and only create a trunc if needed. I believe this should trigger constant folding in the IRBuilder and ultimately do the same thing just with the additional type check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310639
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 10 Aug 2017 17:48:12 +0000 (17:48 +0000)]
[InstCombine] Add a DEBUG_COUNTER to InstCombine to limit how many instructions are visited for debug
Sometimes it would be nice to stop InstCombine mid way through its combining to see the current IR. By using a debug counter we can place an upper limit on how many instructions to process.
This will also allow skipping the first X combines, but that has the potential to change later combines since earlier canonicalizations might have been skipped.
Differential Revision: https://reviews.llvm.org/D36553
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310638
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 10 Aug 2017 17:48:11 +0000 (17:48 +0000)]
[DebugCounter] Move the semicolon out of the DEBUG_COUNTER macro and require it to be placed at the end of each use.
This make it consistent with STATISTIC which it will often appears near.
While there move one DEBUG_COUNTER instance out of an anonymous namespace. It's already declaring a static variable so the namespace is unnecessary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310637
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Thu, 10 Aug 2017 17:38:41 +0000 (17:38 +0000)]
[gold-plugin] Avoid race condition when creating temporary files.
This is both a potential security issue and a potential functionality
issue because we create temporary files from multiple threads. Use
the safe version of createTemporaryFile instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310636
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 10 Aug 2017 17:33:25 +0000 (17:33 +0000)]
[CostModel][X86] Add avx512vbmi broadcast/reverse/single-src shuffle cost tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310633
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 10 Aug 2017 17:27:20 +0000 (17:27 +0000)]
[CostModel][X86] Improve single src shuffle costs
Add missing SK_PermuteSingleSrc costs for AVX2 targets and earlier, also added some of the simpler SK_PermuteTwoSrc costs to support splitting of SK_PermuteSingleSrc shuffles
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310632
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 10 Aug 2017 17:20:09 +0000 (17:20 +0000)]
Fix 'not all control paths return' warning on windows builds. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310631
91177308-0d34-0410-b5e6-
96231b3b80d8
Marek Sokolowski [Thu, 10 Aug 2017 16:46:52 +0000 (16:46 +0000)]
Fixup for r310621: Hint the compilers about unreachable code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310623
91177308-0d34-0410-b5e6-
96231b3b80d8
Marek Sokolowski [Thu, 10 Aug 2017 16:21:44 +0000 (16:21 +0000)]
Add .rc scripts tokenizer.
This extends the shell of llvm-rc tool with the ability of tokenization
of the input files. Currently, ASCII and ASCII-compatible UTF-8 files
are supported.
Thanks to Nico Weber (thakis) for his original work in this area.
Differential Revision: https://reviews.llvm.org/D35957
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310621
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Thu, 10 Aug 2017 16:17:32 +0000 (16:17 +0000)]
Add "Restored" flag to CalleeSavedInfo
The liveness-tracking code assumes that the registers that were saved
in the function's prolog are live outside of the function. Specifically,
that registers that were saved are also live-on-exit from the function.
This isn't always the case as illustrated by the LR register on ARM.
Differential Revision: https://reviews.llvm.org/D36160
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310619
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Thu, 10 Aug 2017 15:37:26 +0000 (15:37 +0000)]
[InstCombine] add memcpy expansion tests with potential DL dependency; NFC
Current behavior is to transform these independently of the datalayout.
There's a proposal to change this in D35035:
https://reviews.llvm.org/D35035
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310611
91177308-0d34-0410-b5e6-
96231b3b80d8
Marcello Maggioni [Thu, 10 Aug 2017 15:35:25 +0000 (15:35 +0000)]
[unittests] Adding a unittest for ChangeTaTargetIndex. NFC
Differential Revision: https://reviews.llvm.org/D36565
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310610
91177308-0d34-0410-b5e6-
96231b3b80d8
Nirav Dave [Thu, 10 Aug 2017 15:29:33 +0000 (15:29 +0000)]
[DAG] Rewrite expression. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310608
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 10 Aug 2017 15:25:08 +0000 (15:25 +0000)]
[CostModel][X86] Added v2f64/v2i64 single src shuffle model tests
Fixed label checks for all prefixes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310606
91177308-0d34-0410-b5e6-
96231b3b80d8
Nirav Dave [Thu, 10 Aug 2017 15:12:32 +0000 (15:12 +0000)]
[X86] Keep dependencies when constructing loads in combineStore
Summary:
Preserve chain dependecies between old and new loads constructed to
prevent loads from reordering below later stores.
Fixes PR34088.
Reviewers: craig.topper, spatel, RKSimon, efriedma
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D36528
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310604
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Thu, 10 Aug 2017 15:07:37 +0000 (15:07 +0000)]
[InstCombine] regenerate test checks; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310603
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Thu, 10 Aug 2017 15:00:30 +0000 (15:00 +0000)]
[Hexagon] Use isMetaInstruction instead of isDebugValue
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310601
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexander Potapenko [Thu, 10 Aug 2017 15:00:13 +0000 (15:00 +0000)]
[sanitizer-coverage] Change cmp instrumentation to distinguish const operands
This implementation of SanitizerCoverage instrumentation inserts different
callbacks depending on constantness of operands:
1. If both operands are non-const, then a usual
__sanitizer_cov_trace_cmp[1248] call is inserted.
2. If exactly one operand is const, then a
__sanitizer_cov_trace_const_cmp[1248] call is inserted. The first
argument of the call is always the constant one.
3. If both operands are const, then no callback is inserted.
This separation comes useful in fuzzing when tasks like "find one operand
of the comparison in input arguments and replace it with the other one"
have to be done. The new instrumentation allows us to not waste time on
searching the constant operands in the input.
Patch by Victor Chibotaru.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310600
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Thu, 10 Aug 2017 14:51:42 +0000 (14:51 +0000)]
[InstCombine] regenerate test checks, add comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310598
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Thu, 10 Aug 2017 14:12:57 +0000 (14:12 +0000)]
[NewGVN] Add CL option to control the generation of phi-of-ops (disable by default).
Differential Revision: https://reviews.llvm.org/
D36478539
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310594
91177308-0d34-0410-b5e6-
96231b3b80d8
Guy Blank [Thu, 10 Aug 2017 14:09:50 +0000 (14:09 +0000)]
[SelectionDAG] Allow constant folding for implicitly truncating BUILD_VECTOR nodes.
In FoldConstantArithmetic, handle BUILD_VECTOR nodes that do implicit truncation on the elements.
This is similar to what is done in FoldConstantVectorArithmetic.
Differential Revision:
https://reviews.llvm.org/D36506
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310593
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexander Potapenko [Thu, 10 Aug 2017 14:01:45 +0000 (14:01 +0000)]
[libFuzzer] Update LibFuzzer w.r.t. the new comparisons instrumentation API
Added the _sanitizer_cov_trace_const_cmp[1248] callbacks.
For now they are implemented the same way as _sanitizer_cov_trace_cmp[1248].
For more details, please see https://reviews.llvm.org/D36465.
Patch by Victor Chibotaru.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310592
91177308-0d34-0410-b5e6-
96231b3b80d8
Oleg Ranevskyy [Thu, 10 Aug 2017 13:37:58 +0000 (13:37 +0000)]
[CMake][LLVM] Remove duplicated library mask. Broken clang linking against clangShared
Summary:
The `LLVM${c}Info` mask is listed twice in LLVM-Config.cmake. This results in the libraries such as LLVMARMInfo, LLVMAArch4Info, etc appearing twice in `extract_symbols.py` command line while building `clangShared`. `Extract_symbols.py` does not work well in such a case and completely ignores the symbols from the duplicated libraries. Thus, the LLVM(...)Info symbols do not get exported from `clangShared` and linking clang against it fails with unresolved dependencies.
Seems to be a mere copy-paste mistake.
Reviewers: beanz, chapuni
Reviewed By: chapuni
Subscribers: chapuni, aemerson, mgorny, kristof.beyls, llvm-commits, asl
Differential Revision: https://reviews.llvm.org/D36119
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310590
91177308-0d34-0410-b5e6-
96231b3b80d8
Nikolai Bozhenov [Thu, 10 Aug 2017 11:24:57 +0000 (11:24 +0000)]
[ValueTracking] Enabling ValueTracking patch by default (recommit). Part 2.
The original patch was an improvement to IR ValueTracking on non-negative
integers. It has been checked in to trunk (D18777, r284022). But was disabled by
default due to performance regressions.
Perf impact has improved. The patch would be enabled by default.
Reviewers: reames, hfinkel
Differential Revision: https://reviews.llvm.org/D34101
Patch by: Olga Chupina <olga.chupina@intel.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310583
91177308-0d34-0410-b5e6-
96231b3b80d8
Zoran Jovanovic [Thu, 10 Aug 2017 10:27:29 +0000 (10:27 +0000)]
[mips][microMIPS] Extending size reduction pass with XOR16
Author: milena.vujosevic.janicic
Reviewers: sdardis
The patch extends size reduction pass for MicroMIPS.
XOR instruction is transformed into 16-bit instruction XOR16, if possible.
Differential Revision: https://reviews.llvm.org/D34239
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310579
91177308-0d34-0410-b5e6-
96231b3b80d8
Sam Parker [Thu, 10 Aug 2017 09:52:55 +0000 (09:52 +0000)]
[AArch64] Assembler support for v8.3 RCpc
Added assembler and disassembler support for the new Release
Consistent processor consistent instructions, introduced with ARM
v8.3-A for AArch64.
Differential Revision: https://reviews.llvm.org/D36522
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310575
91177308-0d34-0410-b5e6-
96231b3b80d8
Sam Parker [Thu, 10 Aug 2017 09:41:00 +0000 (09:41 +0000)]
[ARM][AArch64] ARMv8.3-A enablement
The beta ARMv8.3 ISA specifications have been released for AArch64
and AArch32, these can be found at:
https://developer.arm.com/products/architecture/a-profile/exploration-tools
An introduction to this architecture update can be found at:
https://community.arm.com/processors/b/blog/posts/armv8-a-architecture-2016-additions
This patch is the first in a series which will add ARM v8.3-A support
in LLVM and Clang. It adds the necessary changes that create targets
for both the ARM and AArch64 backends.
Differential Revision: https://reviews.llvm.org/D36514
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310561
91177308-0d34-0410-b5e6-
96231b3b80d8
Elad Cohen [Thu, 10 Aug 2017 07:44:23 +0000 (07:44 +0000)]
[SelectionDAG] When scalarizing vselect, don't assert on
a legal cond operand.
When scalarizing the result of a vselect, the legalizer currently expects
to already have scalarized the operands. While this is true for the true/false
operands (which have the same type as the result), it is not case for the
condition operand. On X86 AVX512, v1i1 is legal - this leads to operations such
as '< N x type> vselect < N x i1> < N x type> < N x type>' where < N x type > is
illegal to hit an assertion during the scalarization.
The handling is similar to r205625.
This also exposes the fact that (v1i1 extract_subvector) should be legal
and selectable on AVX512 - We do this by custom lowering to vector_extract_elt.
This still leaves us in some cases with redundant dag nodes which will be
combined in a separate soon to come patch.
This fixes pr33349.
Differential revision: https://reviews.llvm.org/D36511
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310552
91177308-0d34-0410-b5e6-
96231b3b80d8
Dehao Chen [Thu, 10 Aug 2017 05:10:32 +0000 (05:10 +0000)]
Revert part of r310296 to make it really NFC for instrumentation PGO.
Summary: Part of r310296 will disable PGOIndirectCallPromotion in ThinLTO backend if PGOOpt is None. However, as PGOOpt is not passed down to ThinLTO backend for instrumentation based PGO, that change would actually disable ICP entirely in ThinLTO backend, making it behave differently in instrumentation PGO mode. This change reverts that change, and only disable ICP there when it is SamplePGO.
Reviewers: davidxl
Reviewed By: davidxl
Subscribers: sanjoy, mehdi_amini, eraman, llvm-commits
Differential Revision: https://reviews.llvm.org/D36566
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310550
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Thu, 10 Aug 2017 03:05:21 +0000 (03:05 +0000)]
[LCG] Fix an assert in a on-scope-exit lambda that checked the contents
of the returned value.
Checking the returned value from inside of a scoped exit isn't actually
valid. It happens to work when NRVO fires and the stars align, which
they reliably do with Clang but don't, for example, on MSVC builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310547
91177308-0d34-0410-b5e6-
96231b3b80d8
Hiroshi Yamauchi [Thu, 10 Aug 2017 02:23:14 +0000 (02:23 +0000)]
[LVI] Fix LVI compile time regression around constantFoldUser()
Summary:
Avoid checking each operand and calling getValueFromCondition() before calling
constantFoldUser() when the instruction type isn't supported by
constantFoldUser().
This fixes a large compile time regression in an internal build.
Reviewers: sanjoy
Reviewed By: sanjoy
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D36552
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310545
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Thu, 10 Aug 2017 01:07:44 +0000 (01:07 +0000)]
Linker: Create a function declaration when moving a non-prevailing alias of function type.
We were previously creating a global variable of function type,
which is invalid IR. This issue was exposed by r304690, in which we
started asserting that global variables were of a valid type.
Fixes PR33462.
Differential Revision: https://reviews.llvm.org/D36438
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310543
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 10 Aug 2017 01:02:02 +0000 (01:02 +0000)]
[InstSimplify] Add test cases that show that simplifySelectWithICmpCond doesn't work with non-canonical comparisons.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310542
91177308-0d34-0410-b5e6-
96231b3b80d8
Eugene Zelenko [Thu, 10 Aug 2017 00:46:15 +0000 (00:46 +0000)]
[AMDGPU] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310541
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Wed, 9 Aug 2017 23:24:07 +0000 (23:24 +0000)]
Fix thinlto cache key computation for cfi-icall.
Summary:
Fixed PR33966.
CFI code generation for users (not just callers) of a function depends
on whether this function has a jumptable entry or not. This
information needs to be encoded in of thinlto cache key.
We filter the jumptable list against functions that are actually
referenced in the current module.
Subscribers: mehdi_amini, inglorion, eraman, hiraditya
Differential Revision: https://reviews.llvm.org/D36346
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310536
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 9 Aug 2017 22:22:05 +0000 (22:22 +0000)]
ARM: Fix CMP_SWAP expansion
Clean up after my misguided attempt in r304267 to "fix" CMP_SWAP
returning an uninitialized status value.
- I was always using tMOVi8 to zero the status register which cannot
encode higher register numbers and llvm would silently miscompile)
- Nobody was ever looking at that status value outside the expansion.
ARMDAGToDAGISel::SelectCMP_SWAP() the only place creating CMP_SWAP
instructions was not mapping anything to it. (The cmpxchg status value
from llvm IR is lowered to a manual comparison after the CMP_SWAP)
So this:
- Renames the register from "status" to "temp" it make it obvious that
it isn't used outside the expansion.
- Remove the zeroing status/temp register.
- Keep the live-in list improvements from r304267
Fixes http://llvm.org/PR34056
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310534
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 9 Aug 2017 22:22:04 +0000 (22:22 +0000)]
LangRef: Fix/improve cmpxchg wording
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310533
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 9 Aug 2017 22:06:32 +0000 (22:06 +0000)]
[Path] Sink predicate computations to their uses. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310531
91177308-0d34-0410-b5e6-
96231b3b80d8
Coby Tayree [Wed, 9 Aug 2017 21:49:17 +0000 (21:49 +0000)]
[X86][Asm] Allow negative immediate to appear before bracketed expression
Currently, only non-negative immediate is allowed prior to a brac expression (memory reference).
MASM / GAS does not have any problem cope with the left side of the real line, so we should be able to as well.
Differntial Revision: https://reviews.llvm.org/D36229
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310528
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Wed, 9 Aug 2017 21:22:05 +0000 (21:22 +0000)]
[Hexagon] Ignore DBG_VALUEs when counting instructions in hexagon-early-if
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310524
91177308-0d34-0410-b5e6-
96231b3b80d8
Benoit Belley [Wed, 9 Aug 2017 20:58:39 +0000 (20:58 +0000)]
[Linker] PR33527 - Linker::LinkOnlyNeeded should import AppendingLinkage globals
Linker::LinkOnlyNeeded should always import globals with
AppendingLinkage.
This resolves PR33527.
Differential Revision: https://reviews.llvm.org/D34448
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310522
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 9 Aug 2017 20:55:33 +0000 (20:55 +0000)]
[Docs] Remove a stray period from a code example in the Programmer's Manual.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310520
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Wed, 9 Aug 2017 20:43:31 +0000 (20:43 +0000)]
[llvm-cov] Rearrange entries in report index.
Files which don't contain any functions are likely useless; don't
include them in the main table. Put the links at the bottom of the
page, in case someone wants to figure out coverage for code inside
a macro.
Not sure if this is the best solution, but it seems like an
improvement.
Differential Revision: https://reviews.llvm.org/D36298
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310518
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Wed, 9 Aug 2017 20:19:27 +0000 (20:19 +0000)]
[RuntimeDyld][ORC] Add support for Thumb mode to RuntimeDyldMachOARM.
This patch adds support for thumb relocations to RuntimeDyldMachOARM, and adds
a target-specific flags field to JITSymbolFlags (so that on ARM we can record
whether each symbol is Thumb-mode code).
RuntimeDyldImpl::emitSection is modified to ensure that stubs memory is
correctly aligned based on the size returned by getStubAlignment().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310517
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 9 Aug 2017 20:09:35 +0000 (20:09 +0000)]
AMDGPU: Fix assert on n inline asm constraint
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310515
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Wed, 9 Aug 2017 19:58:00 +0000 (19:58 +0000)]
[Hexagon] Tie implicit uses to defs in predicated instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310514
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Wed, 9 Aug 2017 18:56:26 +0000 (18:56 +0000)]
[SimplifyCFG] remove checks for crasher test from r310481
Not sure why the earlier version would fail, but trying to get the bots
(and my local machine) to pass again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310510
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Wed, 9 Aug 2017 18:37:41 +0000 (18:37 +0000)]
[InstCombine] narrow rotate left/right patterns to eliminate zext/trunc (PR34046)
I couldn't find any smaller folds to help the cases in:
https://bugs.llvm.org/show_bug.cgi?id=34046
after:
rL310141
The truncated rotate-by-variable patterns elude all of the existing transforms because
of multiple uses and knowledge about demanded bits and knownbits that doesn't exist
without the whole pattern. So we need an unfortunately large pattern match. But by
simplifying this pattern in IR, the backend is already able to generate
rolb/rolw/rorb/rorw for x86 using its existing rotate matching logic (although
there is a likely extraneous 'and' of the rotate amount).
Note that rotate-by-constant doesn't have this problem - smaller folds should already
produce the narrow IR ops.
Differential Revision: https://reviews.llvm.org/D36395
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310509
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Wed, 9 Aug 2017 18:34:21 +0000 (18:34 +0000)]
PointerLikeTypeTraits: class->struct & remove the base definition
This simplifies implementations and removing the base definition paves
the way for detecting whether a type is 'pointer like'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310507
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Wed, 9 Aug 2017 18:34:18 +0000 (18:34 +0000)]
Reduce variable scope by moving declaration into if clause
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310506
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Morehouse [Wed, 9 Aug 2017 17:59:43 +0000 (17:59 +0000)]
[asan] Fix instruction emission ordering with dynamic shadow.
Summary:
Instrumentation to copy byval arguments is now correctly inserted
after the dynamic shadow base is loaded.
Reviewers: vitalybuka, eugenis
Reviewed By: vitalybuka
Subscribers: hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D36533
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310503
91177308-0d34-0410-b5e6-
96231b3b80d8
Mandeep Singh Grang [Wed, 9 Aug 2017 17:58:39 +0000 (17:58 +0000)]
[COFF, ARM64] Add MS builtins __dmb, __dsb, __isb
Reviewers: mstorsjo, rnk, ruiu, compnerd, efriedma
Reviewed By: efriedma
Subscribers: efriedma, aemerson, javed.absar, kristof.beyls, llvm-commits
Differential Revision: https://reviews.llvm.org/D36110
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310502
91177308-0d34-0410-b5e6-
96231b3b80d8