OSDN Git Service
Fangrui Song [Sat, 30 Mar 2019 14:08:59 +0000 (14:08 +0000)]
[llvm-objcopy] Replace the size() helper with SectionTableRef::size
Summary:
BTW, STLExtras.h provides llvm::size() which is similar to std::size()
for random access iterators. However, if we prefer qualified
llvm::size(), the member function .size() will be more convenient.
Reviewers: jhenderson, jakehehrlich, rupprecht, grimar, alexshap, espindola
Reviewed By: grimar
Subscribers: emaste, arichardson, jdoerfert, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60028
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357347
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sat, 30 Mar 2019 13:53:11 +0000 (13:53 +0000)]
[X86][SSE] Add PAVG test case from PR41316
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357346
91177308-0d34-0410-b5e6-
96231b3b80d8
Heejin Ahn [Sat, 30 Mar 2019 11:04:48 +0000 (11:04 +0000)]
[WebAssembly] Fix unwind destination mismatches in CFG stackify
Summary:
Linearing the control flow by placing `try`/`end_try` markers can create
mismatches in unwind destinations. This patch resolves these mismatches
by wrapping those instructions with an incorrect unwind destination with
a nested `try`/`catch`/`end_try` and branching to the right destination
within the new catch block.
Reviewers: dschuff
Subscribers: sunfish, sbc100, jgravelle-google, chrib, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D48345
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357343
91177308-0d34-0410-b5e6-
96231b3b80d8
Heejin Ahn [Sat, 30 Mar 2019 09:29:57 +0000 (09:29 +0000)]
[WebAssembly] Run ExplicitLocals pass after CFGStackify
Summary:
While this does not change any final output, this will greatly simplify
ixing unwind destination mismatches in CFGStackify (D48345), because we
have to create some new registers there.
Reviewers: dschuff
Subscribers: sunfish, sbc100, jgravelle-google, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59652
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357342
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Bradbury [Sat, 30 Mar 2019 09:15:47 +0000 (09:15 +0000)]
[RISCV] Add DAGCombine for (SplitF64 (ConstantFP x))
The SplitF64 node is used on RV32D to convert an f64 directly to a pair of i32
(necessary as bitcasting to i64 isn't legal). When performed on a ConstantFP,
this will result in a FP load from the constant pool followed by a store to
the stack and two integer loads from the stack (necessary as there is no way
to directly move between f64 FPRs and i32 GPRs on RV32D). It's always cheaper
to just materialise integers for the lo and hi parts of the FP constant, so do
that instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357341
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Afanasyev [Sat, 30 Mar 2019 08:42:48 +0000 (08:42 +0000)]
Adds `-ftime-trace` option to clang that produces Chrome `chrome://tracing` compatible JSON profiling output dumps.
This change adds hierarchical "time trace" profiling blocks that can be visualized in Chrome, in a "flame chart" style. Each profiling block can have a "detail" string that for example indicates the file being processed, template name being instantiated, function being optimized etc.
This is taken from GitHub PR: https://github.com/aras-p/llvm-project-
20170507/pull/2
Patch by Aras Pranckevičius.
Differential Revision: https://reviews.llvm.org/D58675
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357340
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Bradbury [Sat, 30 Mar 2019 05:24:42 +0000 (05:24 +0000)]
[RISCV][NFC] Remove floating point operations from test/CodeGen/RISCV/vararg.ll
This minimises differences in output when compiling with hardware floating
point support, which will be done in a future patch (to demonstrate the same
vararg calling convention is used).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357339
91177308-0d34-0410-b5e6-
96231b3b80d8
Shoaib Meenai [Sat, 30 Mar 2019 01:35:01 +0000 (01:35 +0000)]
[cmake] Remove use of deprecated generator expression. NFC
Use $<CONFIG> instead of $<CONFIGURATION>, since the latter has been
deprecated since CMake 3.0, and the former is entirely equivalent.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357338
91177308-0d34-0410-b5e6-
96231b3b80d8
Heejin Ahn [Sat, 30 Mar 2019 01:31:11 +0000 (01:31 +0000)]
[WebAssembly] Optimize the number of routing blocks in FixIrreducibleCFG
Summary:
Currently we create a routing block to the dispatch block for every
predecessor of every entry. So the total number of routing blocks
created will be (# of preds) * (# of entries). But we don't need to do
this: we need at most 2 routing blocks per loop entry, one for when the
predecessor is inside the loop and one for it is outside the loop. (We
can't merge these into one because this will creates another loop cycle
between blocks inside and blocks outside) This patch fixes this and
creates at most 2 routing blocks per entry.
This also renames variable `Split` to `Routing`, which I think is a bit
clearer.
Reviewers: kripken
Subscribers: sunfish, dschuff, sbc100, jgravelle-google, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59462
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357337
91177308-0d34-0410-b5e6-
96231b3b80d8
Hubert Tong [Fri, 29 Mar 2019 23:32:47 +0000 (23:32 +0000)]
[Support] Implement is_local_impl with AIX mntctl
Summary:
On AIX, we can determine whether a filesystem is remote using `mntctl`.
If the information is not found, then claim that the file is remote
(since that is the more restrictive case). Testing for the associated
interface is restored with a modified version of the unit test from
rL295768.
Reviewers: jasonliu, xingxue
Reviewed By: xingxue
Subscribers: jsji, apaprocki, Hahnfeld, zturner, krytarowski, kristina, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58801
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357333
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Fri, 29 Mar 2019 23:10:01 +0000 (23:10 +0000)]
[LoopPredication] Remove stale TODO
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357331
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Fri, 29 Mar 2019 23:06:57 +0000 (23:06 +0000)]
[LoopPredication] Use the builder's insertion point everywhere [NFC]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357330
91177308-0d34-0410-b5e6-
96231b3b80d8
Alina Sbirlea [Fri, 29 Mar 2019 22:55:59 +0000 (22:55 +0000)]
[MemorySSA] Temporary fix assert when reaching 0 limit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357327
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Fri, 29 Mar 2019 22:27:10 +0000 (22:27 +0000)]
Try to fix buildbot error
Error is:
llvm/lib/Analysis/ScalarEvolution.cpp:3534:10: error: chosen constructor is explicit in copy-initialization
return {UniqueSCEVs.FindNodeOrInsertPos(ID, IP), std::move(ID), IP};
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/aarch64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/tuple:479:19: note: explicit constructor declared here
constexpr tuple(_UElements&&... __elements)
^
1 error generated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357324
91177308-0d34-0410-b5e6-
96231b3b80d8
Thomas Lively [Fri, 29 Mar 2019 22:00:18 +0000 (22:00 +0000)]
[WebAssembly] Add mutable globals feature
Summary:
This feature is not actually used for anything in the WebAssembly
backend, but adding it allows users to get it into the target features
sections of their objects, which makes these objects
future-compatible.
Reviewers: aheejin, dschuff
Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, jdoerfert, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D60013
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357321
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Fri, 29 Mar 2019 22:00:12 +0000 (22:00 +0000)]
[SCEV] Check the cache in get{S|U}MaxExpr before doing any work
Summary:
This lets us avoid e.g. checking if A >=s B in getSMaxExpr(A, B) if we've
already established that (A smax B) is the best we can do.
Fixes PR41225.
Reviewers: asbirlea
Subscribers: mcrosier, jlebar, bixia, jdoerfert, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60010
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357320
91177308-0d34-0410-b5e6-
96231b3b80d8
Alina Sbirlea [Fri, 29 Mar 2019 21:56:09 +0000 (21:56 +0000)]
[MemorySSA] Limit clobber walks.
Summary: This patch limits all getClobberingMemoryAccess() walks to MaxCheckLimit.
Reviewers: george.burgess.iv
Subscribers: sanjoy, jlebar, Prazek, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59569
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357319
91177308-0d34-0410-b5e6-
96231b3b80d8
Jessica Paquette [Fri, 29 Mar 2019 21:39:36 +0000 (21:39 +0000)]
[GlobalISel][AArch64] Add isel support for G_INSERT_VECTOR_ELT on v2s32s
This adds support for v2s32 vector inserts, and updates the selection +
regbankselect tests for G_INSERT_VECTOR_ELT.
Differential Revision: https://reviews.llvm.org/D59910
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357318
91177308-0d34-0410-b5e6-
96231b3b80d8
Amara Emerson [Fri, 29 Mar 2019 21:30:51 +0000 (21:30 +0000)]
[X86] When using Win64 ABI, exit with error if SSE is disabled for varargs
We need XMM registers to handle varargs with the Win64 ABI. Before we would
silently generate bad code resulting in an assertion failure elsewhere in the
backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357317
91177308-0d34-0410-b5e6-
96231b3b80d8
Alina Sbirlea [Fri, 29 Mar 2019 21:16:31 +0000 (21:16 +0000)]
[MemorySSA] Don't optimize incomplete phis.
Summary:
MemoryPhis cannot be optimized out until they are complete.
Resolves PR41254.
Reviewers: george.burgess.iv
Subscribers: sanjoy, jlebar, Prazek, jdoerfert, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59966
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357315
91177308-0d34-0410-b5e6-
96231b3b80d8
Nirav Dave [Fri, 29 Mar 2019 20:26:23 +0000 (20:26 +0000)]
[DAGCombiner] Rewrite ImproveLifetimeNodeChain to avoid DAG loop.
Avoid EXPENSIVE_CHECK failure. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357309
91177308-0d34-0410-b5e6-
96231b3b80d8
Heejin Ahn [Fri, 29 Mar 2019 19:36:51 +0000 (19:36 +0000)]
[WebAssembly] Handle END_LOOP in unreachable BB in CFGStackify
Summary:
This fixes crashes when a BB in which an END_LOOP is to be placed is
unreachable and does not have any predecessors. Fixes PR41307.
Reviewers: dschuff
Subscribers: yurydelendik, sbc100, jgravelle-google, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60004
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357303
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 29 Mar 2019 19:14:54 +0000 (19:14 +0000)]
AMDGPU: Remove dx10-clamp from subtarget features
Since this can be set with s_setreg*, it should not be a subtarget
property. Set a default based on the calling convention, and Introduce
a new amdgpu-dx10-clamp attribute to override this if desired.
Also introduce a new amdgpu-ieee attribute to match.
The values need to match to allow inlining. I think it is OK for the
caller's dx10-clamp attribute to override the callee, but there
doesn't appear to be the infrastructure to do this currently without
definining the attribute in the generic Attributes.td.
Eventually the calling convention lowering will need to insert a mode
switch somewhere for these.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357302
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Fri, 29 Mar 2019 19:14:52 +0000 (19:14 +0000)]
[Hexagon] Remove fcmp undef from reduced tests
Pre-commit for D60006 (Add fcmp UNDEF handling to SelectionDAG::FoldSetCC)
Approved by @kparzysz (Krzysztof Parzyszek)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357301
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 29 Mar 2019 19:09:37 +0000 (19:09 +0000)]
[X86] Add test cases showing failure to use RMW form of negate when only flags are used. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357300
91177308-0d34-0410-b5e6-
96231b3b80d8
Nirav Dave [Fri, 29 Mar 2019 18:50:22 +0000 (18:50 +0000)]
[DAG] Avoid redundancy in StoreMerge TokenFactor generation.
Avoid generating redundant TokenFactor when all merged stores have
the same chain.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357299
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 29 Mar 2019 18:36:40 +0000 (18:36 +0000)]
[X86] Use cached OptForSize in X86ISelDAGToDAG.cpp instead of pulling it from the function attribute. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357297
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Fri, 29 Mar 2019 18:23:08 +0000 (18:23 +0000)]
[SystemZ] Regenerate double constant comparison test
Prep work for PR40800 (Add UNDEF handling to SelectionDAG::FoldSetCC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357295
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Fri, 29 Mar 2019 18:22:18 +0000 (18:22 +0000)]
[MIPS] Regenerate double constant comparison test
Prep work for PR40800 (Add UNDEF handling to SelectionDAG::FoldSetCC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357294
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Fri, 29 Mar 2019 18:21:19 +0000 (18:21 +0000)]
[ARM] Regenerate execute-only float comparison tests
Prep work for PR40800 (Add UNDEF handling to SelectionDAG::FoldSetCC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357293
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 29 Mar 2019 17:51:39 +0000 (17:51 +0000)]
[InstCombine] autogenerate complete checks; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357291
91177308-0d34-0410-b5e6-
96231b3b80d8
Scott Linder [Fri, 29 Mar 2019 17:49:51 +0000 (17:49 +0000)]
[AMDGPU] Add an additional Code Object V3 assembler example
Document the intended use of the `.amdgcn.next_free_{s,v}gpr` in the
context of multiple kernels and functions.
Differential Revision: https://reviews.llvm.org/D59949
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357289
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 29 Mar 2019 17:47:51 +0000 (17:47 +0000)]
[InstCombine] regenerate test checks; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357288
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Fri, 29 Mar 2019 17:46:06 +0000 (17:46 +0000)]
[AArch64] Regenerate half precision tests
Prep work for PR40800 (Add UNDEF handling to SelectionDAG::FoldSetCC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357286
91177308-0d34-0410-b5e6-
96231b3b80d8
Mircea Trofin [Fri, 29 Mar 2019 17:39:17 +0000 (17:39 +0000)]
[llvm][NFC] Factor out logic for getting incoming & back Loop edges
Reviewers: davidxl
Reviewed By: davidxl
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59967
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357284
91177308-0d34-0410-b5e6-
96231b3b80d8
Nirav Dave [Fri, 29 Mar 2019 17:35:56 +0000 (17:35 +0000)]
[DAGCombine] Prune unnused nodes.
Summary:
Nodes that have no uses are eventually pruned when they are selected
from the worklist. Record nodes newly added to the worklist or DAG and
perform pruning after every combine attempt.
Reviewers: efriedma, RKSimon, craig.topper, spatel, jyknight
Reviewed By: jyknight
Subscribers: jdoerfert, jyknight, nemanjai, jvesely, nhaehnle, javed.absar, hiraditya, jsji, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58070
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357283
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Fri, 29 Mar 2019 17:35:11 +0000 (17:35 +0000)]
[ARM] Regenerate vector comparison tests
Prep work for PR40800 (Add UNDEF handling to SelectionDAG::FoldSetCC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357281
91177308-0d34-0410-b5e6-
96231b3b80d8
Evandro Menezes [Fri, 29 Mar 2019 17:28:11 +0000 (17:28 +0000)]
[CodeGen] Refactor the option for the maximum jump table size
Refactor the option `max-jump-table-size` to default to the maximum
representable number. Essentially, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357280
91177308-0d34-0410-b5e6-
96231b3b80d8
Nirav Dave [Fri, 29 Mar 2019 17:26:40 +0000 (17:26 +0000)]
[DAG] Set up infrastructure to avoid smart constructor-based dangling nodes
Summary:
Various SelectionDAG non-combine operations (e.g. the getNode smart
constructor and legalization) may leave dangling nodes by applying
optimizations without fully pruning unused result values. This results
in nodes that are never added to the worklist and therefore can not be
pruned.
Add a node inserter for the combiner to make sure such nodes have the
chance of being pruned. This allows a number of additional peephole
optimizations.
Reviewers: efriedma, RKSimon, craig.topper, jyknight
Reviewed By: jyknight
Subscribers: msearles, jyknight, sdardis, nemanjai, javed.absar, hiraditya, jrtc27, atanasyan, jsji, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58068
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357279
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Fri, 29 Mar 2019 17:20:27 +0000 (17:20 +0000)]
[X86] Fix some tests using fcmp with undef arguments
Prep work for PR40800 (Add UNDEF handling to SelectionDAG::FoldSetCC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357278
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 29 Mar 2019 16:49:38 +0000 (16:49 +0000)]
[InstCombine] move shuffle canonicalizations before other transforms
This may not be NFC, but I'm not sure how to expose any diffs in
tests. In theory, it should be slightly more efficient and possibly
more profitable to do the canonicalizations (which can increase the
undef elements in the mask) ahead of SimplifyDemandedVectorElts().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357272
91177308-0d34-0410-b5e6-
96231b3b80d8
Jordan Rupprecht [Fri, 29 Mar 2019 16:48:19 +0000 (16:48 +0000)]
[llvm-readobj] Add some generic notes (e.g. NT_VERSION)
Summary: Support reading notes that don't have a standard note name.
Reviewers: MaskRay
Reviewed By: MaskRay
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59969
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357271
91177308-0d34-0410-b5e6-
96231b3b80d8
Jordan Rupprecht [Fri, 29 Mar 2019 16:43:13 +0000 (16:43 +0000)]
[llvm-readelf] Allow prefix flags for -p and -x
Summary: This allows syntax like `llvm-readelf -p.data1 -x.data2`.
Reviewers: jhenderson
Reviewed By: jhenderson
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59965
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357270
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Fri, 29 Mar 2019 15:28:25 +0000 (15:28 +0000)]
[SLP] Add support for commutative icmp/fcmp predicates
For the cases where the icmp/fcmp predicate is commutative, use reorderInputsAccordingToOpcode to collect and commute the operands.
This requires a helper to recognise commutativity in both general Instruction and CmpInstr types - the CmpInst::isCommutative doesn't overload the Instruction::isCommutative method for reasons I'm not clear on (maybe because its based on predicate not opcode?!?).
Differential Revision: https://reviews.llvm.org/D59992
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357266
91177308-0d34-0410-b5e6-
96231b3b80d8
Fangrui Song [Fri, 29 Mar 2019 15:27:58 +0000 (15:27 +0000)]
[llvm-objcopy] Fix case style of LayoutSegments. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357265
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Atanasyan [Fri, 29 Mar 2019 15:15:22 +0000 (15:15 +0000)]
[mips] Fix lowering a signed immediate for *.d MSA instructions
The `lowerMSASplatImm` function zero-extends `i32` immediates while
building constant. If target type is `i64`, negative immediate loses
the sign. As a result, for example `__builtin_msa_ldi_d(-1)` lowered
to series of instruction loads incorrect value 0xffffffff to the `$w0`
register instead of single `ldi.d $w0, -1` instruction.
The fix zero-extends unsigned immediates and signed-extend signed
immediates.
Differential Revision: http://reviews.llvm.org/D59884
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357264
91177308-0d34-0410-b5e6-
96231b3b80d8
Roman Lebedev [Fri, 29 Mar 2019 14:58:01 +0000 (14:58 +0000)]
[NFC][llvm-exegesis] Also promote getSchedClassPoint() into ResolvedSchedClass.
Summary:
It doesn't need anything from Analysis::SchedClassCluster class,
and takes ResolvedSchedClass as param, so this seems rather fitting.
Reviewers: courbet, gchatelet
Reviewed By: courbet
Subscribers: tschuett, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59994
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357263
91177308-0d34-0410-b5e6-
96231b3b80d8
Dmitry Preobrazhensky [Fri, 29 Mar 2019 14:50:20 +0000 (14:50 +0000)]
[AMDGPU][MC] Corrected conversion rules for inlinable constants to match rules for literals
See bug 40806: https://bugs.llvm.org/show_bug.cgi?id=40806
Reviewers: artem.tamazov, arsenm
Differential Revision: https://reviews.llvm.org/D59786
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357262
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Fri, 29 Mar 2019 14:31:28 +0000 (14:31 +0000)]
gn build: Merge r357248
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357261
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Fri, 29 Mar 2019 14:30:01 +0000 (14:30 +0000)]
gn build: Merge r357259
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357260
91177308-0d34-0410-b5e6-
96231b3b80d8
Roman Lebedev [Fri, 29 Mar 2019 14:24:27 +0000 (14:24 +0000)]
[NFC][llvm-exegesis] Refactor ResolvedSchedClass & friends
Summary:
`ResolvedSchedClass` will need to be used outside of `Analysis`
(before `InstructionBenchmarkClustering` even), therefore promote
it into a non-private top-level class, and while there also
move all of the functions that are only called by `ResolvedSchedClass`
into that same new file.
Reviewers: courbet, gchatelet
Reviewed By: courbet
Subscribers: mgorny, tschuett, mgrang, jdoerfert, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59993
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357259
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 29 Mar 2019 14:20:38 +0000 (14:20 +0000)]
[DAGCombiner] simplify shuffle of shuffle
After investigating the examples from D59777 targeting an SSE4.1 machine,
it looks like a very different problem due to how we map illegal types (256-bit in these cases).
We're missing a shuffle simplification that maps elements of a vector back to a shuffled operand.
We have a more general version of this transform in DAGCombiner::visitVECTOR_SHUFFLE(), but that
generality means it is limited to patterns with a one-use constraint, and the examples here have
2 uses. We don't need any uses or legality limitations for a simplification (no new value is
created).
It looks like we miss this pattern in IR too.
In one of the zext examples here, we have shuffle masks like this:
Shuf0 = vector_shuffle<0,u,3,7,0,u,3,7>
Shuf = vector_shuffle<4,u,6,7,u,u,u,u>
...so that's moving the high half of the 1st vector into the low half. But the high half of the
1st vector is already identical to the low half.
Differential Revision: https://reviews.llvm.org/D59961
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357258
91177308-0d34-0410-b5e6-
96231b3b80d8
Florian Hahn [Fri, 29 Mar 2019 14:10:24 +0000 (14:10 +0000)]
Recommit "[DSE] Preserve basic block ordering using OrderedBasicBlock."
Updated to use DenseMap::insert instead of [] operator for insertion, to
avoid a crash caused by epoch checks.
This reverts commit
2b85de438326f9d27bc96dc934ec98b98abdb337.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357257
91177308-0d34-0410-b5e6-
96231b3b80d8
Nirav Dave [Fri, 29 Mar 2019 14:09:47 +0000 (14:09 +0000)]
[DAGCombine] Improve Lifetime node chains.
Improve both start and end lifetime nodes chain dependencies.
Reviewers: courbet
Reviewed By: courbet
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59795
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357256
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 29 Mar 2019 13:49:08 +0000 (13:49 +0000)]
[DAGCombiner] fold sext into decrement
This is a sibling to rL357178 that I noticed we'd hit if we chose
an alternate transform in D59818.
%z = zext i8 %x to i32
%dec = add i32 %z, -1
%r = sext i32 %dec to i64
=>
%z2 = zext i8 %x to i64
%r = add i64 %z2, -1
https://rise4fun.com/Alive/kPP
The x86 vector diffs show a slight regression, so there's a chance
that we should limit this and the previous transform to scalars.
But given that we allowed vectors before, I'm matching that behavior
here. We should change both transforms together if that's the right
thing to do.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357254
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Fri, 29 Mar 2019 13:40:05 +0000 (13:40 +0000)]
Switch lowering: exploit unreachable fall-through when lowering case range cluster
In the example below, we would previously emit two range checks, one for cases
1--3 and one for 4--6. This patch makes us exploit the fact that the
fall-through is unreachable and only one range check is necessary.
switch i32 %i, label %default [
i32 1, label %bb1
i32 2, label %bb1
i32 3, label %bb1
i32 4, label %bb2
i32 5, label %bb2
i32 6, label %bb2
]
default: unreachable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357252
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 29 Mar 2019 13:34:48 +0000 (13:34 +0000)]
[x86] add tests for decrement+sext; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357251
91177308-0d34-0410-b5e6-
96231b3b80d8
Dmitry Preobrazhensky [Fri, 29 Mar 2019 12:16:04 +0000 (12:16 +0000)]
[AMDGPU][MC] Corrected handling of tied src for atomic return MUBUF opcodes
See bug 40917: https://bugs.llvm.org/show_bug.cgi?id=40917
Reviewers: artem.tamazov, arsenm
Differential Revision: https://reviews.llvm.org/D59878
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357249
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrea Di Biagio [Fri, 29 Mar 2019 12:15:37 +0000 (12:15 +0000)]
[MCA] Add an experimental MicroOpQueue stage.
This patch adds an experimental stage named MicroOpQueueStage.
MicroOpQueueStage can be used to simulate a hardware micro-op queue (basically,
a decoupling queue between 'decode' and 'dispatch'). Users can specify a queue
size, as well as a optional MaxIPC (which - in the absence of a "Decoders" stage
- can be used to simulate a different throughput from the decoders).
This stage is added to the default pipeline between the EntryStage and the
DispatchStage only if PipelineOption::MicroOpQueue is different than zero. By
default, llvm-mca sets PipelineOption::MicroOpQueue to the value of hidden flag
-micro-op-queue-size.
Throughput from the decoder can be simulated via another hidden flag named
-decoder-throughput. That flag allows us to quickly experiment with different
frontend throughputs. For targets that declare a loop buffer, flag
-decoder-throughput allows users to do multiple runs, each time simulating a
different throughput from the decoders.
This stage can/will be extended in future. For example, we could add a "buffer
full" event to notify bottlenecks caused by backpressure. flag
-decoder-throughput would probably go away if in future we delegate to another
stage (DecoderStage?) the simulation of a (potentially variable) throughput from
the decoders. For now, flag -decoder-throughput is "good enough" to run some
simple experiments.
Differential Revision: https://reviews.llvm.org/D59928
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357248
91177308-0d34-0410-b5e6-
96231b3b80d8
Konstantin Zhuravlyov [Fri, 29 Mar 2019 12:04:18 +0000 (12:04 +0000)]
AMDGPU: Make sram-ecc off by default for Vega20
Differential Revision: https://reviews.llvm.org/D59718
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357247
91177308-0d34-0410-b5e6-
96231b3b80d8
James Henderson [Fri, 29 Mar 2019 11:47:19 +0000 (11:47 +0000)]
[llvm-readelf]Merge dynamic and static relocation printing to avoid code duplication
The majority of the printRelocation and printDynamicRelocation functions
were identical. This patch factors this all out into a new function.
There are a couple of minor differences to do with printing of symbols
without names, but I think these are harmless, and in some cases a small
improvement.
Reviewed by: grimar, rupprecht, Higuoxing
Differential Revision: https://reviews.llvm.org/D59823
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357246
91177308-0d34-0410-b5e6-
96231b3b80d8
Roman Lebedev [Fri, 29 Mar 2019 11:36:08 +0000 (11:36 +0000)]
[NFC][llvm-exegesis] Refactor Analysis::SchedClassCluster::measurementsMatch()
Summary:
The diff looks scary but it really isn't:
1. I moved the check for the number of measurements into `SchedClassClusterCentroid::validate()`
2. While there, added a check that we can only have a single inverse throughput measurement. I missed that when adding it initially.
3. In `Analysis::SchedClassCluster::measurementsMatch()` is called with the current LLVM values from schedule class and the values from Centroid.
3.1. The values from centroid we can already get from `SchedClassClusterCentroid::getAsPoint()`.
This isn't 100% a NFC, because previously for inverse throughput we used `min()`. I have asked whether i have done that correctly in
https://reviews.llvm.org/D57647?id=184939#inline-510384 but did not hear back. I think `avg()` should be used too, thus it is a fix.
3.2. Finally, refactor the computation of the LLVM-specified values into `Analysis::SchedClassCluster::getSchedClassPoint()`
I will need that function for [[ https://bugs.llvm.org/show_bug.cgi?id=41275 | PR41275 ]]
Reviewers: courbet, gchatelet
Reviewed By: courbet
Subscribers: tschuett, jdoerfert, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59951
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357245
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Fri, 29 Mar 2019 11:25:58 +0000 (11:25 +0000)]
[X86] Add X86TargetLowering::isCommutativeBinOp override.
We currently just have test coverage for PMULUDQ - will add more in the future.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357244
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Fri, 29 Mar 2019 10:41:00 +0000 (10:41 +0000)]
[SLP] Add support for swapping icmp/fcmp predicates to permit vectorization
We should be able to match elements with the swapped predicate as well - as long as we commute the source operands.
Differential Revision: https://reviews.llvm.org/D59956
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357243
91177308-0d34-0410-b5e6-
96231b3b80d8
Kang Zhang [Fri, 29 Mar 2019 08:45:24 +0000 (08:45 +0000)]
[PowerPC] Add the support for __builtin_setrnd()
Summary:
PowerPC64/PowerPC64le supports the builtin function __builtin_setrnd to set the floating point rounding mode. This function will use the least significant two bits of integer argument to set the floating point rounding mode.
double __builtin_setrnd(int mode);
The effective values for mode are:
0 - round to nearest
1 - round to zero
2 - round to +infinity
3 - round to -infinity
Note that the mode argument will modulo 4, so if the int argument is greater than 3, it will only use the least significant two bits of the mode. Namely, builtin_setrnd(102)) is equal to builtin_setrnd(2).
Reviewed By: jsji
Differential Revision: https://reviews.llvm.org/D59405
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357241
91177308-0d34-0410-b5e6-
96231b3b80d8
Clement Courbet [Fri, 29 Mar 2019 08:33:05 +0000 (08:33 +0000)]
[ScheduleDAG] Move `Topo` and `addEdge` to base class.
Some DAG mutations can only be applied to `ScheduleDAGMI`, and have to
internally cast a `ScheduleDAGInstrs` to `ScheduleDAGMI`.
There is nothing actually specific to `ScheduleDAGMI` in `Topo`.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357239
91177308-0d34-0410-b5e6-
96231b3b80d8
Fangrui Song [Fri, 29 Mar 2019 08:08:20 +0000 (08:08 +0000)]
[llvm-objcopy] Delete two redundant reinterpret_cast. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357238
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Lin [Fri, 29 Mar 2019 05:05:21 +0000 (05:05 +0000)]
Test commit. Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357237
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 29 Mar 2019 03:54:56 +0000 (03:54 +0000)]
AMDGPU/GlobalISel: Insert waterfall loop for vector indexing
The register index can only really be an SGPR. Lie that a VGPR index
is legal, and then rewrite the instruction in a waterfall loop to
handle the index.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357235
91177308-0d34-0410-b5e6-
96231b3b80d8
Zi Xuan Wu [Fri, 29 Mar 2019 03:08:39 +0000 (03:08 +0000)]
[PowerPC] Strength reduction of multiply by a constant by shift and add/sub in place
A shift and add/sub sequence combination is faster in place of a multiply by constant.
Because the cycle or latency of multiply is not huge, we only consider such following
worthy patterns.
```
(mul x, 2^N + 1) => (add (shl x, N), x)
(mul x, -(2^N + 1)) => -(add (shl x, N), x)
(mul x, 2^N - 1) => (sub (shl x, N), x)
(mul x, -(2^N - 1)) => (sub x, (shl x, N))
```
And the cycles or latency is subtarget-dependent so that we need consider the
subtarget to determine to do or not do such transformation.
Also data type is considered for different cycles or latency to do multiply.
Differential Revision: https://reviews.llvm.org/D58950
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357233
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Fri, 29 Mar 2019 02:49:13 +0000 (02:49 +0000)]
gn build: Add check-clang-tools to run clang-tools-extra lit tests
Only runs the clang-tools-extra lit tests; not yet the unit tests.
Add a build file for clangd-indexer too, since it's needed for
the tests.
Differential Revision: https://reviews.llvm.org/D59955
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357232
91177308-0d34-0410-b5e6-
96231b3b80d8
Xing GUO [Fri, 29 Mar 2019 01:26:36 +0000 (01:26 +0000)]
[llvm-readobj] Change variable names to match LLVM-style. NFC.
Summary: This patch helps change variable names to match LLVM-style
Reviewers: jhenderson, Higuoxing
Reviewed By: Higuoxing
Subscribers: rupprecht, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59931
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357230
91177308-0d34-0410-b5e6-
96231b3b80d8
Florian Hahn [Fri, 29 Mar 2019 00:22:26 +0000 (00:22 +0000)]
Revert Recommit "[DSE] Preserve basic block ordering using OrderedBasicBlock."
Another buildbot failure
http://lab.llvm.org:8011/builders/clang-cmake-x86_64-sde-avx512-linux/builds/20402
clang-9: /home/ssglocal/clang-cmake-x86_64-sde-avx512-linux/clang-cmake-x86_64-sde-avx512-linux/llvm/include/llvm/ADT/DenseMap.h:1228: llvm::DenseMapIterator<KeyT, ValueT, KeyInfoT, Bucket, IsConst>::value_type* llvm::DenseMapIterator<KeyT, ValueT, KeyInfoT, Bucket, IsConst>::operator->() const [with KeyT = const llvm::Instruction*; ValueT = unsigned int; KeyInfoT = llvm::DenseMapInfo<const llvm::Instruction*>; Bucket = llvm::detail::DenseMapPair<const llvm::Instruction*, unsigned int>; bool IsConst = false; llvm::DenseMapIterator<KeyT, ValueT, KeyInfoT, Bucket, IsConst>::pointer = llvm::detail::DenseMapPair<const llvm::Instruction*, unsigned int>*; llvm::DenseMapIterator<KeyT, ValueT, KeyInfoT, Bucket, IsConst>::value_type = llvm::detail::DenseMapPair<const llvm::Instruction*, unsigned int>]: Assertion `isHandleInSync() && "invalid iterator access!"' failed.
0. Program arguments: /home/ssglocal/clang-cmake-x86_64-sde-avx512-linux/clang-cmake-x86_64-sde-avx512-linux/stage1.install/bin/clang-9 -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name ArchiveCommandLine.cpp -mrelocation-model static -mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu skylake-avx512 -dwarf-column-info -debugger-tuning=gdb -momit-leaf-frame-pointer -coverage-notes-file /home/ssglocal/clang-cmake-x86_64-sde-avx512-linux/clang-cmake-x86_64-sde-avx512-linux/test/sandbox/build/MultiSource/Benchmarks/7zip/Output/ArchiveCommandLine.llvm.gcno -resource-dir /home/ssglocal/clang-cmake-x86_64-sde-avx512-linux/clang-cmake-x86_64-sde-avx512-linux/stage1.install/lib/clang/9.0.0 -I /home/ssglocal/clang-cmake-x86_64-sde-avx512-linux/clang-cmake-x86_64-sde-avx512-linux/test/sandbox/build/MultiSource/Benchmarks/7zip -I /home/ssglocal/clang-cmake-x86_64-sde-avx512-linux/clang-cmake-x86_64-sde-avx512-linux/test/test-suite/MultiSource/Benchmarks/7zip -I /home/ssglocal/clang-cmake-x86_64-sde-avx512-linux/clang-cmake-x86_64-sde-avx512-linux/test/test-suite/include -I ../../../include -D _GNU_SOURCE -D __STDC_LIMIT_MACROS -D NDEBUG -D BREAK_HANDLER -D UNICODE -D _UNICODE -I /home/ssglocal/clang-cmake-x86_64-sde-avx512-linux/clang-cmake-x86_64-sde-avx512-linux/test/test-suite/MultiSource/Benchmarks/7zip/C -I /home/ssglocal/clang-cmake-x86_64-sde-avx512-linux/clang-cmake-x86_64-sde-avx512-linux/test/test-suite/MultiSource/Benchmarks/7zip/CPP/myWindows -I /home/ssglocal/clang-cmake-x86_64-sde-avx512-linux/clang-cmake-x86_64-sde-avx512-linux/test/test-suite/MultiSource/Benchmarks/7zip/CPP/include_windows -I /home/ssglocal/clang-cmake-x86_64-sde-avx512-linux/clang-cmake-x86_64-sde-avx512-linux/test/test-suite/MultiSource/Benchmarks/7zip/CPP -I . -D _FILE_OFFSET_BITS=64 -D _LARGEFILE_SOURCE -D NDEBUG -D _REENTRANT -D ENV_UNIX -D _7ZIP_LARGE_PAGES -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/x86_64-linux-gnu/c++/5.4.0 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/x86_64-linux-gnu/c++/5.4.0 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/backward -internal-isystem /usr/local/include -internal-isystem /home/ssglocal/clang-cmake-x86_64-sde-avx512-linux/clang-cmake-x86_64-sde-avx512-linux/stage1.install/lib/clang/9.0.0/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -O3 -std=gnu++98 -fdeprecated-macro -fdebug-compilation-dir /home/ssglocal/clang-cmake-x86_64-sde-avx512-linux/clang-cmake-x86_64-sde-avx512-linux/test/sandbox/build/MultiSource/Benchmarks/7zip -ferror-limit 19 -fmessage-length 0 -pthread -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -vectorize-loops -vectorize-slp -o Output/ArchiveCommandLine.llvm.o -x c++ /home/ssglocal/clang-cmake-x86_64-sde-avx512-linux/clang-cmake-x86_64-sde-avx512-linux/test/test-suite/MultiSource/Benchmarks/7zip/CPP/7zip/UI/Common/ArchiveCommandLine.cpp -faddrsig
This reverts r357222 (git commit
64cccfcc72c44ea62f441b782d2177a90912769a)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357227
91177308-0d34-0410-b5e6-
96231b3b80d8
Thomas Lively [Fri, 29 Mar 2019 00:14:01 +0000 (00:14 +0000)]
[WebAssembly] Merge used feature sets, update atomics linkage policy
Summary:
It does not currently make sense to use WebAssembly features in some functions
but not others, so this CL adds an IR pass that takes the union of all used
feature sets and applies it to each function in the module. This allows us to
prevent atomics from being lowered away if some function has opted in to using
them. When atomics is not enabled anywhere, we detect whether there exists any
atomic operations or thread local storage that would be stripped and disallow
linking with objects that contain atomics if and only if atomics or tls are
stripped. When atomics is enabled, mark it as used but do not require it of
other objects in the link. These changes allow libraries that do not use atomics
to be built once and linked into both single-threaded and multithreaded
binaries.
Reviewers: aheejin, sbc100, dschuff
Subscribers: jgravelle-google, hiraditya, sunfish, jfb, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59625
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357226
91177308-0d34-0410-b5e6-
96231b3b80d8
Florian Hahn [Thu, 28 Mar 2019 23:11:00 +0000 (23:11 +0000)]
Recommit "[DSE] Preserve basic block ordering using OrderedBasicBlock."
Recommitting after addressing a buildbot failure.
This reverts commit
c87869ebea000dd6483de7c7451cb36c1d36f866.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357222
91177308-0d34-0410-b5e6-
96231b3b80d8
Jordan Rupprecht [Thu, 28 Mar 2019 23:08:06 +0000 (23:08 +0000)]
[llvm-readobj] Fix formatting of unknown note types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357221
91177308-0d34-0410-b5e6-
96231b3b80d8
Puyan Lotfi [Thu, 28 Mar 2019 22:55:08 +0000 (22:55 +0000)]
[yaml2obj] Fixing opening empty yaml files.
Essentially echo "" | yaml2obj crashes. This patch attempts to trim whitespace
and determine if the yaml string in the file is empty or not. If the input is
empty then it will not properly print out an error message and return an error
code.
Differential Revision: https://reviews.llvm.org/D59964
A test/tools/yaml2obj/empty.yaml
M tools/yaml2obj/yaml2obj.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357219
91177308-0d34-0410-b5e6-
96231b3b80d8
Rumeet Dhindsa [Thu, 28 Mar 2019 22:26:51 +0000 (22:26 +0000)]
Update lit config for ld.lld command to match "ld\.lld" instead of trying to match respective regex. (It was able to work with ld-lld and ld1lld as well)
Differential Revision: https://reviews.llvm.org/D59962
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357218
91177308-0d34-0410-b5e6-
96231b3b80d8
Florian Hahn [Thu, 28 Mar 2019 22:17:29 +0000 (22:17 +0000)]
[LSR] Fix signed overflow in GenerateCrossUseConstantOffsets.
For the attached test case, unchecked addition of immediate starts and
ends overflows, as they can be arbitrary i64 constants.
Proof: https://rise4fun.com/Alive/Plqc
Reviewers: qcolombet, gilr, efriedma
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D59218
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357217
91177308-0d34-0410-b5e6-
96231b3b80d8
Yonghong Song [Thu, 28 Mar 2019 21:59:49 +0000 (21:59 +0000)]
[BPF] add proper multi-dimensional array support
For multi-dimensional array like below
int a[2][3];
the previous implementation generates BTF_KIND_ARRAY type
like below:
. element_type: int
. index_type: unsigned int
. number of elements: 6
This is not the best way to represent arrays, esp.,
when converting BTF back to headers and users will see
int a[6];
instead.
This patch generates proper support for multi-dimensional arrays.
For "int a[2][3]", the two BTF_KIND_ARRAY types will be
generated:
Type #n:
. element_type: int
. index_type: unsigned int
. number of elements: 3
Type #(n+1):
. element_type: #n
. index_type: unsigned int
. number of elements: 2
The linux kernel already supports such a multi-dimensional
array representation properly.
Signed-off-by: Yonghong Song <yhs@fb.com>
Differential Revision: https://reviews.llvm.org/D59943
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357215
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Thu, 28 Mar 2019 21:12:28 +0000 (21:12 +0000)]
[MC] Fix floating-point literal lexing.
This patch has three related fixes to improve float literal lexing:
1. Make AsmLexer::LexDigit handle floats without a decimal point more
consistently.
2. Make AsmLexer::LexFloatLiteral print an error for floats which are
apparently missing an "e".
3. Make APFloat::convertFromString use binutils-compatible exponent
parsing.
Together, this fixes some cases where a float would be incorrectly
rejected, fixes some cases where the compiler would crash, and improves
diagnostics in some cases.
Patch by Brandon Jones.
Differential Revision: https://reviews.llvm.org/D57321
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357214
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 28 Mar 2019 20:52:22 +0000 (20:52 +0000)]
[SelectionDAGBuilder] Fix 80 column violation. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357213
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Thu, 28 Mar 2019 20:44:50 +0000 (20:44 +0000)]
[InterleavedAccessPass] Don't increase the number of bytes loaded.
Even if the interleaving transform would otherwise be legal, we shouldn't
introduce an interleaved load that is wider than the original load: it might
have undefined behavior.
It might be possible to perform some sort of mask-narrowing transform in
some cases (using a narrower interleaved load, then extending the
results using shufflevectors). But I haven't tried to implement that,
at least for now.
Fixes https://bugs.llvm.org/show_bug.cgi?id=41245 .
Differential Revision: https://reviews.llvm.org/D59954
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357212
91177308-0d34-0410-b5e6-
96231b3b80d8
Florian Hahn [Thu, 28 Mar 2019 20:36:24 +0000 (20:36 +0000)]
Revert [DSE] Preserve basic block ordering using OrderedBasicBlock.
This reverts r357208 (git commit
c0bfd37d385c93711ef3a349599dba20e6b101ef)
This causes a buildbot failure: http://lab.llvm.org:8011/builders/clang-with-thin-lto-ubuntu/builds/16124
FAILED: lib/IR/CMakeFiles/LLVMCore.dir/IRBuilder.cpp.o
/home/buildslave/ps4-buildslave1/clang-with-thin-lto-ubuntu/install/stage2/bin/clang++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib/IR -I/home/buildslave/ps4-buildslave1/clang-with-thin-lto-ubuntu/llvm.src/lib/IR -Iinclude -I/home/buildslave/ps4-buildslave1/clang-with-thin-lto-ubuntu/llvm.src/include -fPIC -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -fdiagnostics-color -ffunction-sections -fdata-sections -flto=thin -O3 -UNDEBUG -fno-exceptions -fno-rtti -MD -MT lib/IR/CMakeFiles/LLVMCore.dir/IRBuilder.cpp.o -MF lib/IR/CMakeFiles/LLVMCore.dir/IRBuilder.cpp.o.d -o lib/IR/CMakeFiles/LLVMCore.dir/IRBuilder.cpp.o -c /home/buildslave/ps4-buildslave1/clang-with-thin-lto-ubuntu/llvm.src/lib/IR/IRBuilder.cpp
clang-9: /home/buildslave/ps4-buildslave1/clang-with-thin-lto-ubuntu/llvm.src/lib/Analysis/OrderedBasicBlock.cpp:38: bool llvm::OrderedBasicBlock::comesBefore(const llvm::Instruction *, const llvm::Instruction *): Assertion `!(LastInstFound == BB->end() && NextInstPos != 0) && "Instruction supposed to be in NumberedInsts"' failed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357211
91177308-0d34-0410-b5e6-
96231b3b80d8
Florian Hahn [Thu, 28 Mar 2019 20:02:33 +0000 (20:02 +0000)]
[DSE] Preserve basic block ordering using OrderedBasicBlock.
By extending OrderedBB to allow removing and replacing cached
instructions, we can preserve OrderedBBs in DSE easily. This eliminates
one source of quadratic compile time in DSE.
Fixes PR38829.
Reviewers: rnk, efriedma, hfinkel
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D59789
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357208
91177308-0d34-0410-b5e6-
96231b3b80d8
Florian Hahn [Thu, 28 Mar 2019 19:17:31 +0000 (19:17 +0000)]
[MemDepAnalysis] Allow caller to pass in an OrderedBasicBlock.
If the caller can preserve the OBB, we can avoid recomputing the order
for each getDependency call.
Reviewers: efriedma, rnk, hfinkel
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D59788
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357206
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 28 Mar 2019 19:13:38 +0000 (19:13 +0000)]
[SLP][X86] Add tests showing failure to commute icmp/fcmp by swapping predicate
By swapping icmp/fcmp predicates we can commute their operands to improve vectorization
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357204
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 28 Mar 2019 19:03:53 +0000 (19:03 +0000)]
[SLP][X86] Add tests showing failure to commute icmp/fcmp operands
Some predicates are fully commutative - we should be able to easily commute their operands to improve vectorization
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357202
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Thu, 28 Mar 2019 18:34:34 +0000 (18:34 +0000)]
Temporarily revert "SafepointIRVerifier port to new Pass Manager"
to unbreak the modular bots and its follow-up commit.
This reverts commit https://reviews.llvm.org/D59825
because it introduced a
fatal error: cyclic dependency in module 'LLVM_intrinsic_gen': LLVM_intrinsic_gen -> LLVM_IR -> LLVM_intrinsic_gen
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357201
91177308-0d34-0410-b5e6-
96231b3b80d8
Jordan Rupprecht [Thu, 28 Mar 2019 18:27:00 +0000 (18:27 +0000)]
[llvm-objcopy][NFC] Move ELF-specific logic into /ELF/ directory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357199
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 28 Mar 2019 18:05:37 +0000 (18:05 +0000)]
[X86] Teach the isel optimization for (x << C1) op C2 to (x op (C2>>C1)) << C1 to consider cases where C2>>C1 can fit an unsigned 32-bit immediate
For 64-bit operations we should consider if the immediate can be made to fit
in an unsigned 32-bits immedate. For OR/XOR this allows us to load the immediate
with MOV32ri instead of movabsq. For AND this allows us to fold the immediate.
Differential Revision: https://reviews.llvm.org/D59867
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357196
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 28 Mar 2019 17:33:41 +0000 (17:33 +0000)]
Delay initialization of three static global maps, NFC
This avoids allocating a few KB of heap memory on startup, and instead
allocates these maps lazily. I noticed this while profiling LLD.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357192
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Thu, 28 Mar 2019 17:18:42 +0000 (17:18 +0000)]
Make helper functions static. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357187
91177308-0d34-0410-b5e6-
96231b3b80d8
Petar Avramovic [Thu, 28 Mar 2019 16:58:12 +0000 (16:58 +0000)]
[MIPS GlobalISel] Select float constants
Select 32 and 64 bit float constants for MIPS32.
Differential Revision: https://reviews.llvm.org/D59933
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357183
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Thu, 28 Mar 2019 16:53:32 +0000 (16:53 +0000)]
gn build: Add some build files for clangd
Enough to build the clangd binaries, but this is still missing build
files for:
- fuzzer
- indexer
- index/dex/dexp
- benchmarks
- xpc
Differential Revision: https://reviews.llvm.org/D59899
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357182
91177308-0d34-0410-b5e6-
96231b3b80d8
Jordan Rupprecht [Thu, 28 Mar 2019 16:15:28 +0000 (16:15 +0000)]
Add "git llvm revert" and "git llvm svn-lookup" subcommands
Summary:
The current git-svnrevert script only works with git-svn repos (e.g. using "git svn find-rev" to find the commit to revert). This adds a similar implementation that works with the llvm git command handler.
Usage:
```
// Revert by svn id
$ git llvm revert r123456
// See what commands would be run instead of actually reverting
$ git llvm revert -n r123456
<full git revert + git commit commands>
// Git commit hash also fine
$ git llvm revert
abc123456
// For convenience, the git->svn method can be used directly:
$ git llvm svn-lookup
abc123456
r123456
// Push revert upstream (drop the -n when ready)
$ git llvm push -n
```
Regardless of how the command is invoked (with a svn revision or git hash), the message is:
```
Revert [LibFoo] Change Foo implementation
This reverts r123456 (git commit abc123)
```
Reviewers: jyknight, mehdi_amini, jlebar
Reviewed By: jlebar
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59837
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357180
91177308-0d34-0410-b5e6-
96231b3b80d8
Nirav Dave [Thu, 28 Mar 2019 15:53:01 +0000 (15:53 +0000)]
[DAG] Fix Lifetime Node ID hashing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357179
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Thu, 28 Mar 2019 15:46:02 +0000 (15:46 +0000)]
[DAGCombiner] fold sext into negation
As noted in D59818:
%z = zext i8 %x to i32
%neg = sub i32 0, %z
%r = sext i32 %neg to i64
=>
%z2 = zext i8 %x to i64
%r = sub i64 0, %z2
https://rise4fun.com/Alive/KzSR
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357178
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Thu, 28 Mar 2019 15:30:09 +0000 (15:30 +0000)]
[x86] add vector test for sext of negate; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357177
91177308-0d34-0410-b5e6-
96231b3b80d8
Scott Linder [Thu, 28 Mar 2019 15:08:52 +0000 (15:08 +0000)]
[AMDGPU] Clarify Code Object V2/V3 differences in AMDGPUUsage
Ensure Code Object V2 documentation is complete, but always contains a
warning and a link to the equivalent Code Object V3 documentation.
Explicitly indicate that any note records present in a code object that
are not documented must be considered deprecated and ignored.
Differential Revision: https://reviews.llvm.org/D59782
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357176
91177308-0d34-0410-b5e6-
96231b3b80d8