OSDN Git Service
Sanjay Patel [Fri, 23 Feb 2018 17:14:28 +0000 (17:14 +0000)]
[InstCombine] refactor fmul with negated op folds; NFCI
The existing code was inefficiently looking for 'nsz' variants.
That's unnecessary because we canonicalize those to the expected
form with -0.0.
We may also want to adjust or remove the fold that sinks negation.
We don't do that for fdiv (or integer ops?). That should be uniform?
It may also lead to missed optimization as in PR21914:
https://bugs.llvm.org/show_bug.cgi?id=21914
...or we just have to fix other passes to avoid that problem.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325924
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 23 Feb 2018 17:07:29 +0000 (17:07 +0000)]
[InstCombine] use FMF-copying functions to reduce code; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325923
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Fri, 23 Feb 2018 15:55:27 +0000 (15:55 +0000)]
[X86] Regenerate i128 multiply tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325919
91177308-0d34-0410-b5e6-
96231b3b80d8
Stefan Pintilie [Fri, 23 Feb 2018 15:55:16 +0000 (15:55 +0000)]
[PowerPC] Code cleanup. Remove instructions that were withdrawn from Power 9.
The following set of instructions was originally planned to be added for Power 9
and so code was added to support them. However, a decision was made later on to
withdraw support for these instructions in the hardware.
xscmpnedp
xvcmpnesp
xvcmpnedp
This patch removes support for the instructions that were not added.
Differential Revision: https://reviews.llvm.org/D43641
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325918
91177308-0d34-0410-b5e6-
96231b3b80d8
Petar Jovanovic [Fri, 23 Feb 2018 15:47:05 +0000 (15:47 +0000)]
[mips] finish removal of unused fields in MipsInstructionSelector
r325916 missed to remove calls in constructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325917
91177308-0d34-0410-b5e6-
96231b3b80d8
Petar Jovanovic [Fri, 23 Feb 2018 15:34:02 +0000 (15:34 +0000)]
[mips] remove unused fields in MipsInstructionSelector
Unused fields cause buildbreak if -Werror,-Wunused-private-field is passed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325916
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Fri, 23 Feb 2018 13:46:25 +0000 (13:46 +0000)]
Support for the mno-stack-arg-probe flag
Adds support for this flag. There is also another piece for clang
(separate review). More info:
https://bugs.llvm.org/show_bug.cgi?id=36221
By Ruslan Nikolaev!
Differential Revision: https://reviews.llvm.org/D43107
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325900
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonas Paulsson [Fri, 23 Feb 2018 13:22:46 +0000 (13:22 +0000)]
[SystemZ] Also update the CHECK line for VPDI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325898
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonas Paulsson [Fri, 23 Feb 2018 13:20:57 +0000 (13:20 +0000)]
[SystemZ] Fix VPDI argument in test.
To select element 1 from each half with VPDI, a constant of 5 should be used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325897
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Fri, 23 Feb 2018 13:18:13 +0000 (13:18 +0000)]
[X86][F16C] Regenerate half conversion tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325896
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Fri, 23 Feb 2018 12:20:26 +0000 (12:20 +0000)]
llvm-config: Add advapi32 to --system-libs on Windows (PR36372)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325894
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 23 Feb 2018 12:20:18 +0000 (12:20 +0000)]
[WebAssembly] NDEBUG is spelled without a leading underscore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325893
91177308-0d34-0410-b5e6-
96231b3b80d8
Amaury Sechet [Fri, 23 Feb 2018 11:50:42 +0000 (11:50 +0000)]
[DAGCOmbine] Ensure that (brcond (setcc ...)) is handled in a canonical manner.
Summary:
There are transformation that change setcc into other constructs, and transform that try to reconstruct a setcc from the brcond condition. Depending on what order these transform are done, the end result differs.
Most of the time, it is preferable to get a setcc as a brcond argument (and this is why brcond try to recreate the setcc in the first place) so we ensure this is done every time by also doing it at the setcc level when the only user is a brcond.
Reviewers: spatel, hfinkel, niravd, craig.topper
Subscribers: nhaehnle, llvm-commits
Differential Revision: https://reviews.llvm.org/D41235
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325892
91177308-0d34-0410-b5e6-
96231b3b80d8
Nicolai Haehnle [Fri, 23 Feb 2018 11:31:49 +0000 (11:31 +0000)]
Revert "TableGen: Fix typeIsConvertibleTo for record types"
This reverts r325884.
Clang's TableGen has dependencies on the exact ordering of superclasses.
Revert this change fully for now to fix the build.
Change-Id: Ib297f5571cc7809f00838702ad7ab53d47335b26
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325891
91177308-0d34-0410-b5e6-
96231b3b80d8
Petar Jovanovic [Fri, 23 Feb 2018 11:06:40 +0000 (11:06 +0000)]
[MIPS GlobalISel] Adding GlobalISel
Add GlobalISel infrastructure up to the point where we can select a ret
void.
Patch by Petar Avramovic.
Differential Revision: https://reviews.llvm.org/D43583
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325888
91177308-0d34-0410-b5e6-
96231b3b80d8
Nicolai Haehnle [Fri, 23 Feb 2018 10:46:21 +0000 (10:46 +0000)]
TableGen: Avoid using resolveListElementReference in TGParser
A subsequent change intends to remove resolveListElementReference
entirely. This part of the removal can be split out for better
bisectability.
Change-Id: Ibd762d88fd2d1e2cc116a259e2a27a5e9f9a8b10
Reviewers: arsenm, craig.topper, tra, MartinO
Subscribers: wdng, llvm-commits
Differential Revision: https://reviews.llvm.org/D43561
Change-Id: Ifb695041cef1964ad8a3102f448249501a9243f0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325886
91177308-0d34-0410-b5e6-
96231b3b80d8
Nicolai Haehnle [Fri, 23 Feb 2018 10:46:18 +0000 (10:46 +0000)]
TableGen: BitInit and VarBitInit are typed
Summary: Change-Id: I54e337a0b525e9649534bc5f90e5e07c0772e334
Reviewers: arsenm, craig.topper, tra, MartinO
Subscribers: wdng, llvm-commits
Differential Revision: https://reviews.llvm.org/D43560
Change-Id: I07f78e793192974c2b90690ce644589fe4891e41
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325885
91177308-0d34-0410-b5e6-
96231b3b80d8
Nicolai Haehnle [Fri, 23 Feb 2018 10:46:13 +0000 (10:46 +0000)]
TableGen: Fix typeIsConvertibleTo for record types
Summary:
Only check whether the left-hand side type is a subclass (or equal to)
the right-hand side type.
This requires a further fix in handling !if expressions and in type
resolution.
Furthermore, reverse the order of superclasses so that resolveTypes will
find a least common ancestor at least in simple cases.
Add a test that used to be accepted without flagging the obvious type
error.
Change-Id: Ib366db1a4e6a079f1a0851e469b402cddae76714
Reviewers: arsenm, craig.topper, tra, MartinO
Subscribers: wdng, llvm-commits
Differential Revision: https://reviews.llvm.org/D43559
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325884
91177308-0d34-0410-b5e6-
96231b3b80d8
Nicolai Haehnle [Fri, 23 Feb 2018 10:46:07 +0000 (10:46 +0000)]
TableGen: Add !size operation
Summary:
Returns the size of a list. I have found this to be rather useful in some
development for the AMDGPU backend where we could simplify our .td files
by concatenating list<LLVMType> for complex intrinsics. Doing so requires
us to compute the position argument for LLVMMatchType.
Basically, the usage is in a pattern that looks somewhat like this:
list<LLVMType> argtypes =
!listconcat(base,
[llvm_any_ty, LLVMMatchType<!size(base)>]);
Change-Id: I360a0b000fd488d18bea412228230fd93722bd2c
Reviewers: arsenm, craig.topper, tra, MartinO
Subscribers: wdng, llvm-commits, tpr
Differential Revision: https://reviews.llvm.org/D43553
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325883
91177308-0d34-0410-b5e6-
96231b3b80d8
Nicolai Haehnle [Fri, 23 Feb 2018 10:45:56 +0000 (10:45 +0000)]
AMDGPU: Track physreg uses in SILoadStoreOptimizer
Summary:
This handles def-after-use of physregs, and allows us to merge loads and
stores even across some physreg defs (typically M0 defs).
Change-Id: I076484b2bda27c2cf46013c845a0380c5b89b67b
Reviewers: arsenm, mareko, rampitec
Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits
Differential Revision: https://reviews.llvm.org/D42647
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325882
91177308-0d34-0410-b5e6-
96231b3b80d8
Nicolai Haehnle [Fri, 23 Feb 2018 10:45:46 +0000 (10:45 +0000)]
StructurizeCFG: Test for branch divergence correctly
Summary:
This fixes cases like the new test @nonuniform. In that test, %cc itself
is a uniform value; however, when reading it after the end of the loop in
basic block %if, its value is effectively non-uniform.
This problem was encountered in
https://bugs.freedesktop.org/show_bug.cgi?id=103743; however, this change
in itself is not sufficient to fix that bug, as there is another issue
in the AMDGPU backend.
Change-Id: I32bbffece4a32f686fab54964dae1a5dd72949d4
Reviewers: arsenm, rampitec, jlebar
Subscribers: wdng, tpr, llvm-commits
Differential Revision: https://reviews.llvm.org/D40546
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325881
91177308-0d34-0410-b5e6-
96231b3b80d8
Bjorn Steinbrink [Fri, 23 Feb 2018 10:41:57 +0000 (10:41 +0000)]
Mark MergedLoadStoreMotion as not preserving MemDep results
Summary:
MemDep caches results that signify that a dependence is non-local, and
there is currently no way to invalidate such cache entries.
Unfortunately, when MLSM sinks a store that can result in a non-local
dependence becoming a local one, and then MemDep gives wrong answers.
The easiest way out here is to just say that MLSM does indeed not
preserve MemDep results.
Reviewers: davide, Gerolf
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D43177
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325880
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonas Paulsson [Fri, 23 Feb 2018 08:30:15 +0000 (08:30 +0000)]
[Mips] Return true in enableMultipleCopyHints().
Enable multiple COPY hints to eliminate more COPYs during register allocation.
Note that this is something all targets should do, see
https://reviews.llvm.org/D38128.
Review: Simon Dardis
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325870
91177308-0d34-0410-b5e6-
96231b3b80d8
Sam Clegg [Fri, 23 Feb 2018 05:08:34 +0000 (05:08 +0000)]
[WebAssembly] Add first claass symbol table to wasm objects
This is combination of two patches by Nicholas Wilson:
1. https://reviews.llvm.org/D41954
2. https://reviews.llvm.org/D42495
Along with a few local modifications:
- One change I made was to add the UNDEFINED bit to the binary format
to avoid the extra byte used when writing data symbols. Although this
bit is redundant for other symbols types (i.e. undefined can be
implied if a function or global is a wasm import)
- I prefer to be explicit and consistent and not have derived flags.
- Some field renaming.
- Some reverting of unrelated minor changes.
- No test output differences.
Differential Revision: https://reviews.llvm.org/D43147
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325860
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Fri, 23 Feb 2018 01:57:28 +0000 (01:57 +0000)]
Remove file missed by r325852 due to merge conflict.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325853
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Fri, 23 Feb 2018 01:43:46 +0000 (01:43 +0000)]
Revert r325128 ("[X86] Reduce Store Forward Block issues in HW").
This is causing miscompiles in some situations. See the llvm-commits thread for the commit for details.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325852
91177308-0d34-0410-b5e6-
96231b3b80d8
Aditya Nandakumar [Fri, 23 Feb 2018 01:01:59 +0000 (01:01 +0000)]
[GISel]: Fix base case for m_any_of PatternMatcher.
The base case for any_of was incorrectly returning true. Also add test
case which uses m_any_of(preds...) where none of the predicates are
true.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325848
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 23 Feb 2018 00:21:39 +0000 (00:21 +0000)]
[X86] Turn setne X, signedmax into setgt signedmax, X in LowerVSETCC to avoid an invert
We won't be able to fold the constant pool load, but its still better than materialing ones and xoring for the invert if we used PCMPEQ.
This will fix another regression from D42948.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325845
91177308-0d34-0410-b5e6-
96231b3b80d8
Evandro Menezes [Fri, 23 Feb 2018 00:14:39 +0000 (00:14 +0000)]
[AArch64] Refactor macro fusion (NFC)
Move checks for each fusion case into separate functions for better
legibility and maintainability.
Differential revision: https://reviews.llvm.org/D43649
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325844
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Smith [Fri, 23 Feb 2018 00:02:27 +0000 (00:02 +0000)]
[PDB] Check the result of setLoadAddress()
Summary: Change setLoadAddress() to return true or false on failure.
Reviewers: zturner, llvm-commits
Reviewed By: zturner
Differential Revision: https://reviews.llvm.org/D43638
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325843
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 22 Feb 2018 23:59:46 +0000 (23:59 +0000)]
Fix grammar. NFC.
Thank to Eric Christopher for noticing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325842
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 22 Feb 2018 23:46:28 +0000 (23:46 +0000)]
[X86] Turn setne X, signedmin into setgt X, signedmin in LowerVSETCC to avoid an invert
This will fix one of the regressions from D42948.
Differential Revision: https://reviews.llvm.org/D43531
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325840
91177308-0d34-0410-b5e6-
96231b3b80d8
Evandro Menezes [Thu, 22 Feb 2018 23:32:06 +0000 (23:32 +0000)]
[AArch64] Improve macro fusion test case
Improve a vector in the test case for the fusion of address generation and
loads or stores. Otherwise, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325839
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian McCarthy [Thu, 22 Feb 2018 23:16:56 +0000 (23:16 +0000)]
Fix llvm-pdbutil to handle new built-in types
Summary:
The built-in PDB types enum has been extended to include char16_t and char32_t.
llvm-pdbutil was hitting an llvm_unreachable because it didn't know about these
new values. The new values are not yet in the DIA documentation, but are
listed in the cvconst.h header that comes as part of the DIA SDK.
Reviewers: asmith, zturner, rnk
Subscribers: stella.stamenova, llvm-commits, sanjoy
Differential Revision: https://reviews.llvm.org/D43646
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325838
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 22 Feb 2018 23:12:11 +0000 (23:12 +0000)]
Update comment for whether or not we can optimize an alias - we're
checking the alias and not the aliasee. If the alias can be interposed
then we shouldn't do anything.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325837
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Thu, 22 Feb 2018 22:29:27 +0000 (22:29 +0000)]
Fix the build of the wasm backend.
toString conflicts with llvm::toString here. Yay for overly generic
function names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325833
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Thu, 22 Feb 2018 21:46:13 +0000 (21:46 +0000)]
[InstrTypes] add frem and fneg with FMF creators
The more popular opcodes were added at r325730, but we
should have everything here for symmetry. I think both
of these can be used in InstCombine already, but I'll
make those changes as separate clean-ups for InstCombine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325832
91177308-0d34-0410-b5e6-
96231b3b80d8
Paul Robinson [Thu, 22 Feb 2018 21:03:33 +0000 (21:03 +0000)]
[DWARFv5] Turn an assert into a diagnostic. Hand-coded assembler files
should not trigger assertions.
Differential Revision: https://reviews.llvm.org/D43152
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325831
91177308-0d34-0410-b5e6-
96231b3b80d8
Teresa Johnson [Thu, 22 Feb 2018 20:57:05 +0000 (20:57 +0000)]
[ThinLTO/gold] Perform cache pruning when cache directory specified
Summary:
As pointed out in the review for D37993, for consistency with other
linkers, gold plugin should perform cache pruning whenever there is a
cache directory specified, which will use the default cache policy.
Reviewers: pcc
Subscribers: llvm-commits, inglorion
Differential Revision: https://reviews.llvm.org/D43389
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325830
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 22 Feb 2018 20:51:26 +0000 (20:51 +0000)]
[TargetLowering] Rename isCondCodeLegal to isCondCodeLegalOrCustom. Add real isCondCodeLegal. Update callers to use one or the other.
isCondCodeLegal internally checked Legal or Custom which is misleading. Though no targets set any cond code action to Custom today.
So I've renamed isCondCodeLegal to isCondCodeLegalOrCustom and added a real isCondCodeLegal that only checks Legal.
I've changed legalization code to use isCondCodeLegalOrCustom and left things reachable via DAG combine as isCondCodeLegal. I've also changed some places that called getCondCodeAction and compared to Legal to just use isCondCodeLegal.
I'm looking at trying to keep SETCC all the way to isel for the AVX512 integer comparisons and I suspect I'll need to make some condition codes Custom to stop DAG combine from changing things post LegalizeOps. Prior to this only Expand stopped DAG combine, but that causes LegalizeOps to try to swap operands or invert rather than calling our Custom handler.
Differential Revision: https://reviews.llvm.org/D43607
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325829
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Smith [Thu, 22 Feb 2018 20:28:40 +0000 (20:28 +0000)]
[PDB] Add missing override to silence buildbots
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325828
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 22 Feb 2018 20:24:18 +0000 (20:24 +0000)]
[X86] Make the subus special case in LowerVSETCC self contained
Previously this code overrode the flags and opcode used by the later code in LowerVSETCC. This makes the code difficult to read and follow.
This patch moves all the SUBUS code into its own function and makes it responsible for creating its own SDNodes on success.
Differential Revision: https://reviews.llvm.org/D43530
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325827
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Smith [Thu, 22 Feb 2018 20:00:07 +0000 (20:00 +0000)]
[PDB] Fix buildbot failure from missing include for DIAEnumLineNumbers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325826
91177308-0d34-0410-b5e6-
96231b3b80d8
Sander de Smalen [Thu, 22 Feb 2018 19:53:59 +0000 (19:53 +0000)]
Revert "[DebugInfo][FastISel] Fix dropping dbg.value()"
This patch reverts r325440 and r325438 because it triggers an
assertion in SelectionDAGBuilder.cpp. Also having debug enabled
may unintentionally affect code-gen. The patch is reverted until
we find a better solution.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325825
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Smith [Thu, 22 Feb 2018 19:47:43 +0000 (19:47 +0000)]
[PDB] Implement more find methods for PDB symbols
Summary:
Add additional find methods on PDB raw symbols.
findChildrenByAddr()
findChildrenByVA()
findInlineFramesByAddr()
findInlineFramesByVA()
findInlineLines()
findInlineLinesByAddr()
findInlineLinesByRVA()
findInlineLinesByVA()
Reviewers: zturner, llvm-commits
Reviewed By: zturner
Differential Revision: https://reviews.llvm.org/D43637
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325824
91177308-0d34-0410-b5e6-
96231b3b80d8
Easwaran Raman [Thu, 22 Feb 2018 19:44:08 +0000 (19:44 +0000)]
[ThinLTO] Represent relative BF using a scaled representation .
Summary:
The current integer representation of relative block frequency prevents
representing relative block frequencies below 1. This change uses a 8 of
the 29 bits to represent the decimal part by using a fixed scale of -8.
Reviewers: tejohnson, davidxl
Subscribers: mehdi_amini, inglorion, llvm-commits
Differential Revision: https://reviews.llvm.org/D43520
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325823
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Thu, 22 Feb 2018 19:09:07 +0000 (19:09 +0000)]
Fix DataFlowSanitizer instrumentation pass to take parameter position changes into account for custom functions.
When DataFlowSanitizer transforms a call to a custom function, the
new call has extra parameters. The attributes on parameters must be
updated to take the new position of each parameter into account.
Patch by Sam Kerner!
Differential Revision: https://reviews.llvm.org/D43132
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325820
91177308-0d34-0410-b5e6-
96231b3b80d8
Vitaly Buka [Thu, 22 Feb 2018 19:06:15 +0000 (19:06 +0000)]
[ThinLTO] Always create linked objects file for --thinlto-index-only=
Summary:
ThinLTO indexing may decide to skip all objects. If we don't write something to
the list build system may consider this as failure or linker can reuse a file
from the previews build.
Reviewers: pcc, tejohnson
Subscribers: mehdi_amini, inglorion, eraman, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D43415
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325819
91177308-0d34-0410-b5e6-
96231b3b80d8
Vitaly Buka [Thu, 22 Feb 2018 19:06:05 +0000 (19:06 +0000)]
[gold] Extract runLTO to avoid exit(0) from function with non-trivial objects on the stack
Reviewers: tejohnson, pcc
Subscribers: inglorion, llvm-commits
Differential Revision: https://reviews.llvm.org/D43537
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325818
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Morehouse [Thu, 22 Feb 2018 19:00:17 +0000 (19:00 +0000)]
[libFuzzer] Include TEMP_MAX_LEN in Fuzzer::PrintStats.
Reviewers: kcc
Reviewed By: kcc
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D43597
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325817
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Neilson [Thu, 22 Feb 2018 18:55:59 +0000 (18:55 +0000)]
[AlignmentFromAssumptions] Set source and dest alignments of memory intrinsiscs separately
Summary:
This change is part of step five in the series of changes to remove alignment argument from
memcpy/memmove/memset in favour of alignment attributes. In particular, this changes the
AlignmentFromAssumptions pass to cease using the old getAlignment()/setAlignment API of
MemoryIntrinsic in favour of getting/setting source & dest specific alignments through
the new API. This allows us to simplify some of the code in this pass and also be more
aggressive about setting the source and destination alignments separately.
Steps:
Step 1) Remove alignment parameter and create alignment parameter attributes for
memcpy/memmove/memset. ( rL322965, rC322964, rL322963 )
Step 2) Expand the IRBuilder API to allow creation of memcpy/memmove with differing
source and dest alignments. ( rL323597 )
Step 3) Update Clang to use the new IRBuilder API. ( rC323617 )
Step 4) Update Polly to use the new IRBuilder API. ( rL323618 )
Step 5) Update LLVM passes that create memcpy/memmove calls to use the new IRBuilder API,
and those that use use MemIntrinsicInst::[get|set]Alignment() to use [get|set]DestAlignment()
and [get|set]SourceAlignment() instead. ( rL323886, rL323891, rL324148, rL324273, rL324278,
rL324384, rL324395, rL324402, rL324626, rL324642, rL324653, rL324654, rL324773, rL324774,
rL324781, rL324784, rL324955, rL324960 )
Step 6) Remove the single-alignment IRBuilder API for memcpy/memmove, and the
MemIntrinsicInst::[get|set]Alignment() methods.
Reference
http://lists.llvm.org/pipermail/llvm-dev/2015-August/089384.html
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-
20151109/312083.html
Reviewers: hfinkel, bollu, reames
Reviewed By: reames
Subscribers: reames, llvm-commits
Differential Revision: https://reviews.llvm.org/D43081
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325816
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 22 Feb 2018 18:45:13 +0000 (18:45 +0000)]
[SelectionDAG] Move matchUnaryPredicate/matchBinaryPredicate into SelectionDAGNodes.h
This allows us to improve vector constant matching in more DAG code (backends, TargetLowering etc.).
Differential Revision: https://reviews.llvm.org/D43466
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325815
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 22 Feb 2018 18:06:48 +0000 (18:06 +0000)]
[MC] Don't crash on modulo by zero (PR35650)
Extension to D12776, handle modulo by zero in the same way we handle divide by zero.
Differential Revision: https://reviews.llvm.org/D43631
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325810
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Thu, 22 Feb 2018 17:33:20 +0000 (17:33 +0000)]
[IRBuilder] add creators for FP with FMF; NFCI
Also, add a helper for the constant folder to reduce duplication.
It seems out-of-place for and/or to be doing simplifications here?
Otherwise, I could have used the helper on those opcodes too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325808
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 22 Feb 2018 16:29:08 +0000 (16:29 +0000)]
[X86][AVX512] Add DQ+VLX scalar int<->fp tests cases for D43441
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325804
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Bataev [Thu, 22 Feb 2018 16:20:30 +0000 (16:20 +0000)]
[DEBUGINFO] Do not output labels for empty macinfo sections.
Summary:
If there is no debug info for macros, do not emit labels for empty
macinfo sections.
Reviewers: probinson, echristo
Subscribers: aprantl, llvm-commits, JDevlieghere
Differential Revision: https://reviews.llvm.org/D43589
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325803
91177308-0d34-0410-b5e6-
96231b3b80d8
Nicolai Haehnle [Thu, 22 Feb 2018 15:27:12 +0000 (15:27 +0000)]
TableGen: Add strict assertions to sanity check earlier type checking
Summary:
Both of these errors should have been caught by type-checking during
parsing.
Change-Id: I891087936fd1a91d21bcda57c256e3edbe12b94d
Reviewers: arsenm, craig.topper, tra, MartinO
Subscribers: wdng, llvm-commits
Differential Revision: https://reviews.llvm.org/D43558
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325800
91177308-0d34-0410-b5e6-
96231b3b80d8
Nicolai Haehnle [Thu, 22 Feb 2018 15:27:03 +0000 (15:27 +0000)]
TableGen: Allow implicit casting between string and code
Summary:
Perhaps the distinction between the two should be removed entirely
in the long term, and the [{ ... }] syntax should just be a convenient
way of writing multi-line strings.
In the meantime, a lot of existing .td files are quite relaxed about
string vs. code, and this change allows switching on more consistent
type checks without breaking those.
Change-Id: If85e3e04469e41b58e2703b62ac0032d2711713c
Reviewers: arsenm, craig.topper, tra, MartinO
Subscribers: wdng, llvm-commits
Differential Revision: https://reviews.llvm.org/D43557
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325799
91177308-0d34-0410-b5e6-
96231b3b80d8
Nicolai Haehnle [Thu, 22 Feb 2018 15:26:45 +0000 (15:26 +0000)]
TableGen: Fix type of resolved and converted lists
Summary:
There are no new test cases, but a subsequent patch will introduce
assertions that would be triggered by existing test cases without this
fix.
Change-Id: I6a82d4b311b012aff3932978ae86f6a2dcfbf725
Reviewers: arsenm, craig.topper, tra, MartinO
Subscribers: wdng, llvm-commits
Differential Revision: https://reviews.llvm.org/D43556
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325798
91177308-0d34-0410-b5e6-
96231b3b80d8
Nicolai Haehnle [Thu, 22 Feb 2018 15:26:35 +0000 (15:26 +0000)]
TableGen: Fix type deduction for !foreach
Summary:
In the case of !foreach(id, input-list, transform) where the type of
input-list is list<A> and the type of transform is B, we now correctly
deduce list<B> as the type of the !foreach.
Change-Id: Ia19dd65eecc5991dd648280ba6a15f6a20fd61de
Reviewers: arsenm, craig.topper, tra, MartinO
Subscribers: wdng, llvm-commits
Differential Revision: https://reviews.llvm.org/D43555
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325797
91177308-0d34-0410-b5e6-
96231b3b80d8
Nicolai Haehnle [Thu, 22 Feb 2018 15:26:28 +0000 (15:26 +0000)]
TableGen: Generalize type deduction for !listconcat
Summary:
This way, it should work even with complex operands.
Change-Id: Iaccf5bbb50bd5882a0ba5d59689e4381315fb361
Reviewers: arsenm, craig.topper, tra, MartinO
Subscribers: wdng, llvm-commits
Differential Revision: https://reviews.llvm.org/D43554
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325796
91177308-0d34-0410-b5e6-
96231b3b80d8
Nicolai Haehnle [Thu, 22 Feb 2018 15:26:21 +0000 (15:26 +0000)]
TableGen: Add some more helpful error messages
Summary: Some fairly simple changes to start with.
Reviewers: arsenm, craig.topper, tra, MartinO
Subscribers: wdng, llvm-commits
Differential Revision: https://reviews.llvm.org/D43552
Change-Id: I0c92731b36d309c6edfcae42595ae1a70cc051c9
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325795
91177308-0d34-0410-b5e6-
96231b3b80d8
Nicolai Haehnle [Thu, 22 Feb 2018 15:25:11 +0000 (15:25 +0000)]
AMDGPU: Stop using .NAME in .td files
Summary:
.NAME is a bit of an odd duck, in that we should really treat it like
a template argument, but we currently don't, and so when and where
NAME is initialized and how is pretty inconsistent. Best to just avoid
using it as a field of already instantiated records, and use cast to
string instead.
Change-Id: I5a0c202401cede3d5c3827ab9c7858ea48b29108
Reviewers: arsenm, rampitec
Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits
Differential Revision: https://reviews.llvm.org/D43551
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325794
91177308-0d34-0410-b5e6-
96231b3b80d8
Shiva Chen [Thu, 22 Feb 2018 15:02:28 +0000 (15:02 +0000)]
[RISCV] Implement c.lui immediate operand constraint
Implement c.lui immediate constraint to [1, 31] and [0xfffe0, 0xfffff].
The RISC-V ISA describes the constraint as [1, 63], with that value
being loaded in to bits 17-12 of the destination register and sign extended
from bit 17. Therefore, this 6-bit immediate can represent values in the
ranges [1, 31] and [0xfffe0, 0xfffff].
Differential Revision: https://reviews.llvm.org/D42834
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325792
91177308-0d34-0410-b5e6-
96231b3b80d8
Luke Cheeseman [Thu, 22 Feb 2018 14:42:08 +0000 (14:42 +0000)]
[FunctionAttrs][ArgumentPromotion][GlobalOpt] Disable some optimisations passes for naked functions
- Fix for bug 36078.
- Prevent the functionattrs, function-attrs, globalopt and argpromotion passes
from changing naked functions.
- These passes can perform some alterations to the functions that should not be
applied. An example is removing parameters that are seemingly not used because
they are only referenced in the inline assembly. Another example is marking
the function as fastcc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325788
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Thu, 22 Feb 2018 14:27:16 +0000 (14:27 +0000)]
[InstCombine] add fmul multi-use test; NFC
Also, rename tests to make their intent clearer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325785
91177308-0d34-0410-b5e6-
96231b3b80d8
Stefan Maksimovic [Thu, 22 Feb 2018 13:40:42 +0000 (13:40 +0000)]
[mips] Generate memory dependencies for byVal arguments
There were no memory dependencies made between stores generated
when lowering formal arguments and loads generated when
call lowering byVal arguments which made the Post-RA scheduler
place a load before a matching store.
Make the fixed object stored to mutable so that the load
instructions can have their memory dependencies added
Set the frame object as isAliased which clears the underlying
objects vector in ScheduleDAGInstrs::buildSchedGraph().
This results in addition of all stores as dependenies for loads.
This problem appeared when passing a byVal parameter
coupled with a fastcc function call.
Differential Revision: https://reviews.llvm.org/D37515
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325782
91177308-0d34-0410-b5e6-
96231b3b80d8
Serge Guelton [Thu, 22 Feb 2018 13:30:32 +0000 (13:30 +0000)]
Syndicate duplicate code between CallInst and InvokeInst
NFC intended, syndicate common code to a parametric base class. Part of the original problem is that InvokeInst is a TerminatorInst, unlike CallInst. the problem is solved by introducing a parametrized class paramtertized by its base.
Differential Revision: https://reviews.llvm.org/D40727
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325778
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 22 Feb 2018 13:28:42 +0000 (13:28 +0000)]
Fix Wdocumentation warning - remove param tag for old argument
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325777
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Bradbury [Thu, 22 Feb 2018 13:24:25 +0000 (13:24 +0000)]
[RISCV][NFC] Make logic in RISCVMCCodeEmitter::getImmOpValue more defensive
As pointed out by @sabuasal in a comment on D23568, the logic in
RISCVMCCodeEmitter::getImmOpValue could be more defensive. Although with the
current instruction definitions it is always the case that `VK_RISCV_LO` is
always used with either an I- or S-format instruction, this may not always be
the case in the future. Add a check to ensure we will get an assertion in
debug builds if that changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325775
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 22 Feb 2018 12:19:34 +0000 (12:19 +0000)]
[SLPVectorizer][X86] Add load extend tests (PR36091)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325772
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Dardis [Thu, 22 Feb 2018 11:53:01 +0000 (11:53 +0000)]
[mips] Regenerate tests for D38128 (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325770
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonas Devlieghere [Thu, 22 Feb 2018 11:43:43 +0000 (11:43 +0000)]
[dsymutil] Remove \brief from comments. NFC
With autobrief enabled, these server no purpose anymore. Most of them
were already removed but this makes everything consistent.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325769
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonas Devlieghere [Thu, 22 Feb 2018 11:32:51 +0000 (11:32 +0000)]
[dsymutil] Fix typos and formatting. NFC.
Some over-due gardening: this fixes a bunch of typos and makes the
formatting consistent with LLVM's style guide.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325768
91177308-0d34-0410-b5e6-
96231b3b80d8
Sjoerd Meijer [Thu, 22 Feb 2018 10:43:57 +0000 (10:43 +0000)]
Recommit: [ARM] f16 constant pool fix
This recommits r325754; the modified and failing test case
actually didn't need any modifications.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325765
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonas Devlieghere [Thu, 22 Feb 2018 09:42:10 +0000 (09:42 +0000)]
[dsymutil] Replace PATH_MAX in SmallString with fixed value.
Apparently the Windows bots don't know this define, so just going with a
sensible default.
Failing builds:
http://lab.llvm.org:8011/builders/lldb-x86-windows-msvc2015/builds/19179
http://lab.llvm.org:8011/builders/lld-x86_64-win7/builds/19263
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325762
91177308-0d34-0410-b5e6-
96231b3b80d8
David Green [Thu, 22 Feb 2018 09:38:57 +0000 (09:38 +0000)]
[ARM] Fix issue with large xor constants.
Fixup to rL325573 for large xor constants.
Thanks to Eli Friedman for the catch.
Differential revision: https://reviews.llvm.org/D43549
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325761
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonas Devlieghere [Thu, 22 Feb 2018 09:20:40 +0000 (09:20 +0000)]
[dsymutil] Be smarter in caching calls to realpath
Calling realpath is expensive but necessary to perform the uniqueing in
dsymutil. Although we already cached the results for every individual
file in the line table, we had reports of it taking 40 seconds of a 3.5
minute link.
This patch adds a second level of caching. When we do have to call
realpath, we cache its result for its parents path. We didn't replace
the existing caching, because it's fast (indexed) and saves us from
reading the line table for entries we've already seen.
For WebkitCore this results in a decrease of 11% in linking time: from
85.79 to 76.11 seconds (average over 3 runs).
Differential revision: https://reviews.llvm.org/D43511
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325757
91177308-0d34-0410-b5e6-
96231b3b80d8
Sjoerd Meijer [Thu, 22 Feb 2018 08:41:55 +0000 (08:41 +0000)]
Revert r325754 and r325755 (f16 literal pool) because buildbots were unhappy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325756
91177308-0d34-0410-b5e6-
96231b3b80d8
Sjoerd Meijer [Thu, 22 Feb 2018 08:20:50 +0000 (08:20 +0000)]
Added a test that I forgot to svn add in my previous commit r325754.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325755
91177308-0d34-0410-b5e6-
96231b3b80d8
Sjoerd Meijer [Thu, 22 Feb 2018 08:16:05 +0000 (08:16 +0000)]
[ARM] f16 constant pool fix
This is a follow up of r325012, that allowed half types in constant pools.
Proper alignment was enforced when a big basic block was split up, but not when
a CPE was placed before/after a block; the successor block had the wrong
alignment.
Differential Revision: https://reviews.llvm.org/D43580
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325754
91177308-0d34-0410-b5e6-
96231b3b80d8
Hiroshi Inoue [Thu, 22 Feb 2018 07:48:29 +0000 (07:48 +0000)]
[NFC] fix trivial typos in comments
"a a" -> "a"
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325752
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 22 Feb 2018 07:05:27 +0000 (07:05 +0000)]
[DAGCombiner] Add two calls to isVector before making calls to getVectorElementType/getVectorNumElements to avoid an assert.
We looked through a BITCAST, but the bitcast might be a from a scalar type rather than a vector.
I don't have a test case. I stumbled onto it while prototyping another change that isn't ready yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325750
91177308-0d34-0410-b5e6-
96231b3b80d8
Mircea Trofin [Thu, 22 Feb 2018 06:42:57 +0000 (06:42 +0000)]
[SampleProf] NFC. Expose reusable functionality in SampleProfile.
Summary:
Exposing getOffset and findFunctionSamples as members of
SampleProfile. They are intimately tied to design choices of the
sample profile format - using offsets instead of line numbers, and
traversing inlined functions stack, respectively.
Reviewers: davidxl
Reviewed By: davidxl
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D43605
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325747
91177308-0d34-0410-b5e6-
96231b3b80d8
Max Kazantsev [Thu, 22 Feb 2018 06:27:32 +0000 (06:27 +0000)]
[SCEV][NFC] Factor out common logic into a separate method
SCEV has multiple occurences of code when we need to prove some predicate on
every iteration of a loop and do it with invocations of couple `isLoopEntryGuardedByCond`,
`isLoopBackedgeGuardedByCond`. This patch factors out these two calls into a separate
method. It is a preparation step to extend this logic: it is not the only way how we can prove
such conditions.
Differential Revision: https://reviews.llvm.org/D43373
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325745
91177308-0d34-0410-b5e6-
96231b3b80d8
Nemanja Ivanovic [Thu, 22 Feb 2018 03:02:41 +0000 (03:02 +0000)]
[PowerPC] Do not produce invalid CTR loop with an FRem
An FRem instruction inside a loop should prevent the loop from being converted
into a CTR loop since this is not an operation that is legal on any PPC
subtarget. This will always be a call to a library function which means the
loop will be invalid if this instruction is in the body.
Fixes PR36292.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325739
91177308-0d34-0410-b5e6-
96231b3b80d8
Vedant Kumar [Thu, 22 Feb 2018 01:29:41 +0000 (01:29 +0000)]
[Utils] Avoid a hash table lookup in salvageDI, NFC
According to the current coverage report salvageDebugInfo() is called
5.12 million times during testing and almost always returns early.
The early return depends on LocalAsMetadata::getIfExists returning null,
which involves a DenseMap lookup in an LLVMContextImpl. We can probably
speed this up by simply checking the IsUsedByMD bit in Value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325738
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 21 Feb 2018 23:07:30 +0000 (23:07 +0000)]
[X86][MMX] Generlize MMX_MOVD64rr combines to accept v4i16/v8i8 build vectors as well as v2i32
Also handle both cases where the lower 32-bits of the MMX is undef or zero extended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325736
91177308-0d34-0410-b5e6-
96231b3b80d8
Yonghong Song [Wed, 21 Feb 2018 22:59:14 +0000 (22:59 +0000)]
bpf: disable DwarfUsesRelocationsAcrossSections
The pahole does not work with BPF backend properly:
-bash-4.2$ cat test.c
struct test_t {
int a;
int b;
};
int test(struct test_t *s) {
return s->a;
}
-bash-4.2$ clang -g -O2 -target bpf -c test.c
-bash-4.2$ pahole test.o
struct clang version 7.0.0 (trunk 325446) (llvm/trunk 325464) {
clang version 7.0.0 (trunk 325446) (llvm/trunk 325464) clang version 7.0.0 (trunk 325446) (llvm/trunk 325464); /* 0 4 */
clang version 7.0.0 (trunk 325446) (llvm/trunk 325464) clang version 7.0.0 (trunk 325446) (llvm/trunk 325464); /* 4 4 */
/* size: 8, cachelines: 1, members: 2 */
/* last cacheline: 8 bytes */
};
-bash-4.2$
The reason is that BPF backend is not yet implemented in elfutils backend
https://github.com/threatstack/elfutils/tree/master/backends
and pahole depends on elfutils for dwarf parsing and resolving relocation.
More specifically, the unsupported relocation in .debug_info for type/member name
against symbol table caused the incorrect result above. The following is
the raw .rel.debug_info for the above example,
Hex dump of section '.rel.debug_info':
0x00000000
06000000 00000000 0a000000 0b000000 ................
0x00000010
0c000000 00000000 0a000000 01000000 ................
0x00000020
12000000 00000000 0a000000 02000000 ................
0x00000030
16000000 00000000 0a000000 0e000000 ................
0x00000040
1a000000 00000000 0a000000 03000000 ................
----------------- -------- --------
reloc location type symtab index
Hex dump of section '.debug_info':
0x00000000
7b000000 04000000 00000801 00000000 {...............
0x00000010
0c000000 00000000 00000000 00000000 ................
0x00000020
00000000 00001000 00000200 00000000 ................
Based on "type", the proper value will be extracted from symbol table
and filled in .debug_info so later on .debug_info can be properly
resolved against debug strings.
There are two ways to fix this problem. One is to fix elfutils by adding
BPF support which is desirable. This could take a long time and won't work
with already deployed pahole. For a short term workaround, we can disable
dwarf cross-section relation which specifically avoids debug_info and
symbol table cross relocation. This should help any dwarf-related tool
which has not implement BPF specific relocations yet.
Now .rel.debug_info does not have any relocation for symbol table and
.debug_info itself contains necessary relocation information by itself.
Hex dump of section '.debug_info':
0x00000000
7b000000 04000000 00000801 00000000 {...............
0x00000010
0c003700 00000000 00003e00 00000000 ..7.......>.....
0x00000020
00000000 00001000 00000200 00000000 ................
location 0xc has 0, 0x12 has 0x37, 0x1a has 0x3e in place which
will be used in relocation resolution. Here, the values of 0, 0x37 and 0x3e
are offset in .debug_str section.
Please note the difference between two above .debug_info dumps.
With the fix, pahole works properly with BPF backend:
-bash-4.2$ clang -O2 -g -target bpf -c test.c
-bash-4.2$ pahole test.o
struct test_t {
int a; /* 0 4 */
int b; /* 4 4 */
/* size: 8, cachelines: 1, members: 2 */
/* last cacheline: 8 bytes */
};
Signed-off-by: Yonghong Song <yhs@fb.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325735
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Wed, 21 Feb 2018 22:48:28 +0000 (22:48 +0000)]
[InstCombine] add some random FMF to tests so we know it's not dropped; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325734
91177308-0d34-0410-b5e6-
96231b3b80d8
Pavel Labath [Wed, 21 Feb 2018 22:36:31 +0000 (22:36 +0000)]
Resubmit r325107 (case folding DJB hash)
The issue was that the has function was generating different results depending
on the signedness of char on the host platform. This commit fixes the issue by
explicitly using an unsigned char type to prevent sign extension and
adds some extra tests.
The original commit message was:
This patch implements a variant of the DJB hash function which folds the
input according to the algorithm in the Dwarf 5 specification (Section
6.1.1.4.5), which in turn references the Unicode Standard (Section 5.18,
"Case Mappings").
To achieve this, I have added a llvm::sys::unicode::foldCharSimple
function, which performs this mapping. The implementation of this
function was generated from the CaseMatching.txt file from the Unicode
spec using a python script (which is also included in this patch). The
script tries to optimize the function by coalescing adjecant mappings
with the same shift and stride (terms I made up). Theoretically, it
could be made a bit smarter and merge adjecant blocks that were
interrupted by only one or two characters with exceptional mapping, but
this would save only a couple of branches, while it would greatly
complicate the implementation, so I deemed it was not worth it.
Since we assume that the vast majority of the input characters will be
US-ASCII, the folding hash function has a fast-path for handling these,
and only whips out the full decode+fold+encode logic if we encounter a
character outside of this range. It might be possible to implement the
folding directly on utf8 sequences, but this would also bring a lot of
complexity for the few cases where we will actually need to process
non-ascii characters.
Reviewers: JDevlieghere, aprantl, probinson, dblaikie
Subscribers: mgorny, hintonda, echristo, clayborg, vleschuk, llvm-commits
Differential Revision: https://reviews.llvm.org/D42740
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325732
91177308-0d34-0410-b5e6-
96231b3b80d8
Tobias Edler von Koch [Wed, 21 Feb 2018 22:27:07 +0000 (22:27 +0000)]
[Hexagon] Add TargetRegisterInfo::getPointerRegClass() override
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325731
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Wed, 21 Feb 2018 22:18:55 +0000 (22:18 +0000)]
[InstCombine] add and use Create*FMF functions; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325730
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 21 Feb 2018 22:10:48 +0000 (22:10 +0000)]
[X86][MMX] Add MMX_MOVD64rr build vector tests showing undef elements in the lower half
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325729
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Wed, 21 Feb 2018 21:55:57 +0000 (21:55 +0000)]
[ORC] Switch to shared_ptr ownership for SymbolSources in VSOs.
This makes it easy to free a SymbolSource (and any related
resources) when the last reference in a VSO is dropped.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325727
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Wed, 21 Feb 2018 21:55:54 +0000 (21:55 +0000)]
[ORC] Switch from a StringMap to an internal VSO in RTDyldObjectLinkingLayer.
This is a first step towards switching to VSOs as the primary symbol tables in
ORC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325726
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Wed, 21 Feb 2018 21:55:49 +0000 (21:55 +0000)]
[ORC] Switch RTDyldObjectLinkingLayer to take a unique_ptr<MemoryBuffer> rather
than a shared ObjectFile/MemoryBuffer pair.
There's no need to pre-parse the buffer into an ObjectFile before passing it
down to the linking layer, and moving the parsing into the linking layer allows
us remove the parsing code at each call site.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325725
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Wed, 21 Feb 2018 20:48:14 +0000 (20:48 +0000)]
[AArch64] fix IR names to not be 'tmp' because that gives the CHECK script problems
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325718
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Wed, 21 Feb 2018 20:34:16 +0000 (20:34 +0000)]
[AArch64] add SLP test for matmul (PR36280); NFC
This is a slight reduction of one of the benchmarks
that suffered with D43079. Cost model changes should
not cause this test to remain scalarized.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325717
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 21 Feb 2018 20:12:18 +0000 (20:12 +0000)]
Revert "[IRMover] Implement name based structure type mapping"
This reverts commit r325686.
There was a misunderstanding and this has not been approved yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325715
91177308-0d34-0410-b5e6-
96231b3b80d8