]> granicus.if.org Git - llvm/log
llvm
5 years agoAMDGPU/GlobalISel: Select local loads
Matt Arsenault [Thu, 1 Aug 2019 00:53:38 +0000 (00:53 +0000)]
AMDGPU/GlobalISel: Select local loads

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

5 years agoRevert "[MS] Emit S_HEAPALLOCSITE debug info in Selection DAG" and
Amy Huang [Wed, 31 Jul 2019 23:59:31 +0000 (23:59 +0000)]
Revert "[MS] Emit S_HEAPALLOCSITE debug info in Selection DAG" and
and partial fix.
Causes windows buildbot errors.

This reverts commit 6e65c34523963094acd0d6c94a5f5c64b32fe6aa and
53da7ca94343166ac68aef81db0398932fc258bb.

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

5 years agoFix build when both gtest death tests and LLVM_NODISCARD are available.
Richard Smith [Wed, 31 Jul 2019 23:37:24 +0000 (23:37 +0000)]
Fix build when both gtest death tests and LLVM_NODISCARD are available.

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

5 years ago[ARM] Lower "(x<<c) > 0x80000000U" to "lsls" on Thumb1.
Eli Friedman [Wed, 31 Jul 2019 23:19:21 +0000 (23:19 +0000)]
[ARM] Lower "(x<<c) > 0x80000000U" to "lsls" on Thumb1.

This is extremely specific, but saves three instructions when it's
legal.  I don't think the code can be usefully generalized.

Differential Revision: https://reviews.llvm.org/D65351

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

5 years ago[ARM] Transform compare of masked value to shift on Thumb1.
Eli Friedman [Wed, 31 Jul 2019 23:17:34 +0000 (23:17 +0000)]
[ARM] Transform compare of masked value to shift on Thumb1.

Thumb1 has very limited immediate modes, so turning an "and" into a
shift can save multiple instructions.

It's possible to simplify the generated code for test2 and test3 in
cmp-and-fold.ll a little more, but I'll implement that as a followup.

Differential Revision: https://reviews.llvm.org/D65175

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

5 years ago[ConstExprPreter] Overflow-detecting methods use GCC or clang builtins
JF Bastien [Wed, 31 Jul 2019 23:09:18 +0000 (23:09 +0000)]
[ConstExprPreter] Overflow-detecting methods use GCC or clang builtins

 Differential Revision: https://reviews.llvm.org/D65536

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

5 years ago[ScalarizeMaskedMemIntrin] Bitcast the mask to the scalar domain and use scalar bit...
Craig Topper [Wed, 31 Jul 2019 22:58:15 +0000 (22:58 +0000)]
[ScalarizeMaskedMemIntrin] Bitcast the mask to the scalar domain and use scalar bit tests for the branches.

X86 at least is able to use movmsk or kmov to move the mask to the scalar
domain. Then we can just use test instructions to test individual bits.

This is more efficient than extracting each mask element
individually.

I special cased v1i1 to use the previous behavior. This avoids
poor type legalization of bitcast of v1i1 to i1.

I've skipped expandload/compressstore as I think we need to
handle constant masks for those better first.

Many tests end up with duplicate test instructions due to tail
duplication in the branch folding pass. But the same thing
happens when constructing similar code in C. So its not unique
to the scalarization.

Not sure if this lowering code will also be good for other targets,
but we're only testing X86 today.

Differential Revision: https://reviews.llvm.org/D65319

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

5 years ago[X86] Add DAG combine to fold any_extend_vector_inreg+truncstore to an extractelement...
Craig Topper [Wed, 31 Jul 2019 22:43:08 +0000 (22:43 +0000)]
[X86] Add DAG combine to fold any_extend_vector_inreg+truncstore to an extractelement+store

We have custom code that ignores the normal promoting type legalization on less than 128-bit vector types like v4i8 to emit pavgb, paddusb, psubusb since we don't have the equivalent instruction on a larger element type like v4i32. If this operation appears before a store, we can be left with an any_extend_vector_inreg followed by a truncstore after type legalization. When truncstore isn't legal, this will normally be decomposed into shuffles and a non-truncating store. This will then combine away the any_extend_vector_inreg and shuffle leaving just the store. On avx512, truncstore is legal so we don't decompose it and we had no combines to fix it.

This patch adds a new DAG combine to detect this case and emit either an extract_store for 64-bit stoers or a extractelement+store for 32 and 16 bit stores. This makes the avx512 codegen match the avx2 codegen for these situations. I'm restricting to only when -x86-experimental-vector-widening-legalization is false. When we're widening we're not likely to create this any_extend_inreg+truncstore combination. This means we should be able to remove this code when we flip the default. I would like to flip the default soon, but I need to investigate some performance regressions its causing in our branch that I wasn't seeing on trunk.

Differential Revision: https://reviews.llvm.org/D65538

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

5 years agoAttempt to unbreak sphinx build bot by inserting a link.
Philip Reames [Wed, 31 Jul 2019 22:14:26 +0000 (22:14 +0000)]
Attempt to unbreak sphinx build bot by inserting a link.

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

5 years agoMigrate some more fadd and fsub cases away from UnsafeFPMath control to utilize NoSig...
Michael Berg [Wed, 31 Jul 2019 21:57:28 +0000 (21:57 +0000)]
Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize NoSignedZerosFPMath options control

Summary: Honoring no signed zeroes is also available as a user control through clang separately regardless of fastmath or UnsafeFPMath context, DAG guards should reflect this context.

Reviewers: spatel, arsenm, hfinkel, wristow, craig.topper

Reviewed By: spatel

Subscribers: rampitec, foad, nhaehnle, wuzish, nemanjai, jvesely, wdng, javed.absar, MaskRay, jsji

Differential Revision: https://reviews.llvm.org/D65170

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

5 years ago[IndVars, RLEV] Support rewriting exit values in loops without known exits (prep...
Philip Reames [Wed, 31 Jul 2019 21:15:21 +0000 (21:15 +0000)]
[IndVars, RLEV] Support rewriting exit values in loops without known exits (prep work)

This is a prepatory patch for future work on support exit value rewriting in loops with a mixture of computable and non-computable exit counts.  The intention is to be "mostly NFC" - i.e. not enable any interesting new transforms - but in practice, there are some small output changes.

The test differences are caused by cases wherewhere getSCEVAtScope can simplify a single entry phi without needing any knowledge of the loop.

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

5 years ago[NFC] allow creating error strings from a Twine
JF Bastien [Wed, 31 Jul 2019 21:09:53 +0000 (21:09 +0000)]
[NFC] allow creating error strings from a Twine

It's useful when no format needs to happen, only the Twine needs to be put together.

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

5 years agoFix to r367374 "[MS] Emit S_HEAPALLOCSITE debug info in Selection DAG"
Amy Huang [Wed, 31 Jul 2019 21:03:38 +0000 (21:03 +0000)]
Fix to r367374 "[MS] Emit S_HEAPALLOCSITE debug info in Selection DAG"
after windows buildbot failure.

Added a check that the MachineInstr exists and is a call before trying
to add symbols around it.

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

5 years agoFix unused variable warning for non-assert builds.
Eric Christopher [Wed, 31 Jul 2019 21:02:03 +0000 (21:02 +0000)]
Fix unused variable warning for non-assert builds.

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

5 years ago[GISel] Address review feedback on passing MD_callees to lowerCall.
Mark Lacey [Wed, 31 Jul 2019 20:34:05 +0000 (20:34 +0000)]
[GISel] Address review feedback on passing MD_callees to lowerCall.

Preserve the nullptr default for KnownCallees that appears in
the base class.

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

5 years ago[GISel] Pass MD_callees metadata down in call lowering.
Mark Lacey [Wed, 31 Jul 2019 20:34:02 +0000 (20:34 +0000)]
[GISel] Pass MD_callees metadata down in call lowering.

Summary:
This will make it possible to improve IPRA by taking into account
register usage in indirect calls.

NFC yet; this is just laying the groundwork to start building
up patches to take advantage of the information for improved register
allocation.

Reviewers: aditya_nandakumar, volkan, qcolombet, arsenm, rovka, aemerson, paquette

Subscribers: sdardis, wdng, javed.absar, hiraditya, jrtc27, atanasyan, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D65488

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

5 years agoAArch64: Add a tagged-globals backend feature.
Peter Collingbourne [Wed, 31 Jul 2019 20:14:19 +0000 (20:14 +0000)]
AArch64: Add a tagged-globals backend feature.

This feature instructs the backend to allow locally defined global variable
addresses to contain a pointer tag in bits 56-63 that will be ignored by
the hardware (i.e. TBI), but may be used by an instrumentation pass such
as HWASAN. It works by adding a MOVK instruction to the regular ADRP/ADD
sequence that sets bits 48-63 to the corresponding bits of the global, with
the linker bounds check disabled on the ADRP instruction to prevent the tag
from causing a link failure.

This implementation of the feature omits the MOVK when loading from or storing
to a global, which is sufficient for TBI. If the same approach is extended
to MTE, assuming that 0 is not configured as a catch-all tag, we will most
likely also need the MOVK in this case in order to avoid a tag mismatch.

Differential Revision: https://reviews.llvm.org/D65364

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

5 years agoSelectionDAG, MI, AArch64: Widen target flags fields/arguments from unsigned char...
Peter Collingbourne [Wed, 31 Jul 2019 20:14:09 +0000 (20:14 +0000)]
SelectionDAG, MI, AArch64: Widen target flags fields/arguments from unsigned char to unsigned.

This makes the field wider than MachineOperand::SubReg_TargetFlags so that
we don't end up silently truncating any higher bits. We should still catch
any bits truncated from the MachineOperand field as a consequence of the
assertion in MachineOperand::setTargetFlags().

Differential Revision: https://reviews.llvm.org/D65465

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

5 years ago[DAGCombine] Limit the number of times for the same store and root nodes
Wei Mi [Wed, 31 Jul 2019 19:59:24 +0000 (19:59 +0000)]
[DAGCombine] Limit the number of times for the same store and root nodes
to bail out in store merging dependence check.

We run into a case where dependence check in store merging bail out many times
for the same store and root nodes in a huge basicblock. That increases compile
time by almost 100x. The patch add a map to track how many times the bailing
out happen for the same store and root, and if it is over a limit, stop
considering the store with the same root as a merging candidate.

Differential Revision: https://reviews.llvm.org/D65174

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

5 years ago[Support] Added overflow checking add, sub and mul.
JF Bastien [Wed, 31 Jul 2019 19:40:07 +0000 (19:40 +0000)]
[Support] Added overflow checking add, sub and mul.

Added AddOverflow, SubOverflow and MulOverflow to compute truncated results and return a flag indicating whether overflow occured.

 Differential Revision: https://reviews.llvm.org/D65494

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

5 years ago[X86] Add test cases to show premature decomposition of vector multiplies into shift...
Craig Topper [Wed, 31 Jul 2019 19:05:11 +0000 (19:05 +0000)]
[X86] Add test cases to show premature decomposition of vector multiplies into shift+add/sub for types that aren't legal and need to be split. NFC

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

5 years ago[X86] Add AVX512DQ command lines to vector-mul.ll to show that we use vpmullq instead...
Craig Topper [Wed, 31 Jul 2019 19:05:03 +0000 (19:05 +0000)]
[X86] Add AVX512DQ command lines to vector-mul.ll to show that we use vpmullq instead of shift+add/sub for some cases. NFC

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

5 years agogn build: Merge r367463
Nico Weber [Wed, 31 Jul 2019 18:56:49 +0000 (18:56 +0000)]
gn build: Merge r367463

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

5 years ago[SCCP] Update condition to avoid overflow.
Alina Sbirlea [Wed, 31 Jul 2019 18:22:22 +0000 (18:22 +0000)]
[SCCP] Update condition to avoid overflow.

Summary:
Update condition to remove addition that may cause an overflow.
Resolves PR42814.

Reviewers: sanjoy, RKSimon

Subscribers: jlebar, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D65417

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

5 years agocompiler-rt: Rename .cc file in lib/profile to .cpp
Nico Weber [Wed, 31 Jul 2019 18:21:08 +0000 (18:21 +0000)]
compiler-rt: Rename .cc file in lib/profile to .cpp

See https://reviews.llvm.org/D58620 for discussion.

Note how the comment in the file already said ".cpp" :)

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

5 years ago[docs] Add references to unreferenced footnotes.
Lang Hames [Wed, 31 Jul 2019 18:07:37 +0000 (18:07 +0000)]
[docs] Add references to unreferenced footnotes.

Thanks to Stefan Granitz for catching the issue.

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

5 years agogn build: Merge r367456
Nico Weber [Wed, 31 Jul 2019 18:04:03 +0000 (18:04 +0000)]
gn build: Merge r367456

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

5 years agogn build: Merge r367452 and add standalone sources
Nico Weber [Wed, 31 Jul 2019 17:56:45 +0000 (17:56 +0000)]
gn build: Merge r367452 and add standalone sources

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

5 years ago[MemorySSA] Add additional verification for phis.
Alina Sbirlea [Wed, 31 Jul 2019 17:41:04 +0000 (17:41 +0000)]
[MemorySSA] Add additional verification for phis.

Summary:
Verify that the incoming defs into phis are the last defs from the
respective incoming blocks.
When moving blocks, insertDef must RenameUses. Adding this verification
makes GVNHoist tests fail that uncovered this issue.

Reviewers: george.burgess.iv

Subscribers: jlebar, Prazek, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D63147

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

5 years agogn build: Add build files for compiler-rt/lib/profile
Nico Weber [Wed, 31 Jul 2019 17:15:32 +0000 (17:15 +0000)]
gn build: Add build files for compiler-rt/lib/profile

Differential Revision: https://reviews.llvm.org/D65518

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

5 years agogn build: Make builtin library build on macOS
Nico Weber [Wed, 31 Jul 2019 17:12:33 +0000 (17:12 +0000)]
gn build: Make builtin library build on macOS

For now, it only builds the x86_64 slice.

Differential Revision: https://reviews.llvm.org/D65513

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

5 years agogn build: Fix redundant object files in builtin lib.
Nico Weber [Wed, 31 Jul 2019 17:08:34 +0000 (17:08 +0000)]
gn build: Fix redundant object files in builtin lib.

compiler-rt's builtin library has generic implementations of many
functions, and then per-arch optimized implementations of some.

In the CMake build, both filter_builtin_sources() and an explicit loop
at the end of the build file (see D37166) filter out the generic
versions if a per-arch file is present.

The GN build wasn't doing this filtering. Just do the filtering manually
and explicitly, instead of being clever.

While here, also remove files from the mingw/arm build that are
redundantly listed after D39938 / r318139 (both from the CMake and the
GN build).

While here, also fix a target_os -> target_cpu typo.

Differential Revision: https://reviews.llvm.org/D65512

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

5 years ago[InstCombine] canonicalize fneg before fmul/fdiv
Sanjay Patel [Wed, 31 Jul 2019 16:53:22 +0000 (16:53 +0000)]
[InstCombine] canonicalize fneg before fmul/fdiv

Reverse the canonicalization of fneg relative to fmul/fdiv. That makes it
easier to implement the transforms (and possibly other fneg transforms) in
1 place because we can always start the pattern match from fneg (either the
legacy binop or the new unop).

There's a secondary practical benefit seen in PR21914 and PR42681:
https://bugs.llvm.org/show_bug.cgi?id=21914
https://bugs.llvm.org/show_bug.cgi?id=42681
...hoisting fneg rather than sinking seems to play nicer with LICM in IR
(although this change may expose analysis holes in the other direction).

1. The instcombine test changes show the expected neutral IR diffs from
   reversing the order.

2. The reassociation tests show that we were missing an optimization
   opportunity to fold away fneg-of-fneg. My reading of IEEE-754 says
   that all of these transforms are allowed (regardless of binop/unop
   fneg version) because:

   "For all other operations [besides copy/abs/negate/copysign], this
   standard does not specify the sign bit of a NaN result."
   In all of these transforms, we always have some other binop
   (fadd/fsub/fmul/fdiv), so we are free to flip the sign bit of a
   potential intermediate NaN operand.
   (If that interpretation is wrong, then we must already have a bug in
   the existing transforms?)

3. The clang tests shouldn't exist as-is, but that's effectively a
   revert of rL367149 (the test broke with an extension of the
   pre-existing fneg canonicalization in rL367146).

Differential Revision: https://reviews.llvm.org/D65399

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

5 years agoReland "[DwarfDebug] Dump call site debug info"
Djordje Todorovic [Wed, 31 Jul 2019 16:51:28 +0000 (16:51 +0000)]
Reland "[DwarfDebug] Dump call site debug info"

The build failure found after the rL365467 has been
resolved.

Differential Revision: https://reviews.llvm.org/D60716

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

5 years ago[docs][FIX] Add missing word to documentation in terms of SCCs
Johannes Doerfert [Wed, 31 Jul 2019 16:48:42 +0000 (16:48 +0000)]
[docs][FIX] Add missing word to documentation in terms of SCCs

In the approval of D65299, commited as rL367440, I mentioned that my
proposed wording was lacking the word "maximal". It is added now for
correctness.

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

5 years ago[build] Add the ability to create a symlink for lipo
Anusha Basana [Wed, 31 Jul 2019 16:46:57 +0000 (16:46 +0000)]
[build] Add the ability to create a symlink for lipo

Add user enabled option to create lipo with symlink to llvm-lipo
Used rL326381 for reference.

Differential Revision: https://reviews.llvm.org/D65477

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

5 years ago[AMDGPU] Fix for vectorizer crash with pointers of different size
Stanislav Mekhanoshin [Wed, 31 Jul 2019 16:33:11 +0000 (16:33 +0000)]
[AMDGPU] Fix for vectorizer crash with pointers of different size

When vectorizer strips pointers it can eventually end up with
pointers of two different sizes, then SCEV will crash.

Differential Revision: https://reviews.llvm.org/D65480

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

5 years ago[docs] Reword documentation in terms of SCCs not cycles
Philip Reames [Wed, 31 Jul 2019 16:24:20 +0000 (16:24 +0000)]
[docs] Reword documentation in terms of SCCs not cycles

Given the example:
header:
  br i1 %c, label %next, label %header
next:
  br i1 %c2, label %exit, label %header

We end up with a loop containing both header and next.  Given that, the describing the loop in terms of cycles is confusing since we have multiple distinct cycles within a single Loop.  Standardize on the SCC to clarify.

Differential Revision: https://reviews.llvm.org/D65299

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

5 years ago[NFC][InstCombine] Add xor-or-icmp tests with icmp having extra uses
Roman Lebedev [Wed, 31 Jul 2019 15:20:33 +0000 (15:20 +0000)]
[NFC][InstCombine] Add xor-or-icmp tests with icmp having extra uses

Currently InstCombiner::foldXorOfICmps() bailouts if the
ICMP it wants to invert has extra uses. As it can be seen
in the tests in previous commit, this is super unfortunate,
this is the single pattern that is left non-canonicalized.

We could analyze if we can also invert all the uses if said ICMP
at the same time, thus not bailing out there.
I'm not seeing any nicer alternative.

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

5 years ago[NFC][InstCombine] Add baseline tests with non-canonical CLAMP pattern
Roman Lebedev [Wed, 31 Jul 2019 15:20:21 +0000 (15:20 +0000)]
[NFC][InstCombine] Add baseline tests with non-canonical CLAMP pattern

As disscussed in https://reviews.llvm.org/D65148#1603922
these would all need to be canonicalized to traditional clamp pattern.

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

5 years ago[AARCH64] Switch relocations R_AARCH64_TLS_TPREL64 and R_AARCH64_DTPMOD64
Peter Smith [Wed, 31 Jul 2019 14:42:57 +0000 (14:42 +0000)]
[AARCH64] Switch relocations R_AARCH64_TLS_TPREL64 and R_AARCH64_DTPMOD64

The ELF for the Arm 64-bit Architecture document originally specified
R_AARCH64_TLS_DTPREL64 = 0x404
R_AARCH64_TLS_DTPMOD64 = 0x405

LLVM correctly followed the document. Unfortunately in binutils these
two codes were reversed:
R_AARCH64_TLS_DTPMOD64 = 0x404
R_AARCH64_TLS_DTPREL64 = 0x405
Given that binaries had shipped this change has become the defacto standard
interpretation of these relocation codes for any toolchain that wanted to
remain compatible with GNU.

To recognize this the latest version of the ABI document has renamed
the relocations to R_AARCH64_TLS_IMPDEF1 and R_AARCH64_TLS_IMPDEF2
permitting a toolchain to choose between the two relocation types, and
recommending that toolchains follow the GNU interpretation for maximum
compatibility.

Given that upstream llvm has never implemented the standard TLS model for
AArch64 so we have no binary legacy, synchronize with GCC so that we don't
create incompatible objects in the future. So far the only visible change
is in llvm-readobj as it can decode these relocations. Tthis change will
mean that llvm-readobj decodes the same way as GNU readelf.

fixes PR40507

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

5 years ago[X86] Moved IsNOT helper earlier. NFCI.
Simon Pilgrim [Wed, 31 Jul 2019 14:36:04 +0000 (14:36 +0000)]
[X86] Moved IsNOT helper earlier. NFCI.

Makes it available for more combines to use without adding declarations.

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

5 years ago[X86][SSE] Add test cases for PR42825
Simon Pilgrim [Wed, 31 Jul 2019 14:29:44 +0000 (14:29 +0000)]
[X86][SSE] Add test cases for PR42825

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

5 years ago[ARM] Reject CSEL instructions with invalid operands
Mikhail Maltsev [Wed, 31 Jul 2019 14:22:45 +0000 (14:22 +0000)]
[ARM] Reject CSEL instructions with invalid operands

Summary:
According to the Armv8.1-M manual CSEL, CSINC, CSINV and CSNEG are
"constrained unpredictable" when SP is used as the source register Rn.

The assembler should diagnose this case.

Reviewers: momchil.velikov, dmgreen, ostannard, simon_tatham, t.p.northover

Reviewed By: ostannard

Subscribers: javed.absar, kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D65505

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

5 years ago[IPSCCP] Move callsite check to the beginning of the loop.
Florian Hahn [Wed, 31 Jul 2019 12:57:04 +0000 (12:57 +0000)]
[IPSCCP] Move callsite check to the beginning of the loop.

We have some code marks instructions with struct operands as overdefined,
but if the instruction is a call to a function with tracked arguments,
this breaks the assumption that the lattice values of all call sites
are not overdefined and will be replaced by a constant.

This also re-adds the assertion from D65222, with additionally skipping
non-callsite uses. This patch should address the cases reported in which
the assertion fired.

Fixes PR42738.

Reviewers: efriedma, davide

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D65439

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

5 years ago[X86][AVX] Ensure chained subvector insertions are the same size (PR42833)
Simon Pilgrim [Wed, 31 Jul 2019 12:55:39 +0000 (12:55 +0000)]
[X86][AVX] Ensure chained subvector insertions are the same size (PR42833)

Before combining insert_subvector(insert_subvector(vec, sub0, c0), sub1, c1) patterns, ensure that the subvectors are all the same type. On AVX512 targets especially we might have a mixture of 128/256 subvector insertions.

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

5 years ago[AArch64] Add support for Transactional Memory Extension (TME)
Momchil Velikov [Wed, 31 Jul 2019 12:52:17 +0000 (12:52 +0000)]
[AArch64] Add support for Transactional Memory Extension (TME)

Re-commit r366322 after some fixes

TME is a future architecture technology, documented in

  https://developer.arm.com/architectures/cpu-architecture/a-profile/exploration-tools
  https://developer.arm.com/docs/ddi0601/a

More about the future architectures:

  https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/new-technologies-for-the-arm-a-profile-architecture

This patch adds support for the TME instructions TSTART, TTEST, TCOMMIT, and
TCANCEL and the target feature/arch extension "tme".

It also implements TME builtin functions, defined in ACLE Q2 2019
(https://developer.arm.com/docs/101028/latest)

Differential Revision: https://reviews.llvm.org/D64416

Patch by Javed Absar and Momchil Velikov

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

5 years ago[LLVM] Fix Alignment death tests in Release Mode
Guillaume Chatelet [Wed, 31 Jul 2019 12:47:20 +0000 (12:47 +0000)]
[LLVM] Fix Alignment death tests in Release Mode

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

5 years ago[X86] Regenerate lrshrink test checks to make D65354 diff easier
Simon Pilgrim [Wed, 31 Jul 2019 12:30:24 +0000 (12:30 +0000)]
[X86] Regenerate lrshrink test checks to make D65354 diff easier

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

5 years ago[X86] Regenerate callee-saved test checks to make D65354 diff easier
Simon Pilgrim [Wed, 31 Jul 2019 12:29:07 +0000 (12:29 +0000)]
[X86] Regenerate callee-saved test checks to make D65354 diff easier

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

5 years ago[X86] Regenerate alias-static-alloca test checks to make D65354 diff easier
Simon Pilgrim [Wed, 31 Jul 2019 12:27:47 +0000 (12:27 +0000)]
[X86] Regenerate alias-static-alloca test checks to make D65354 diff easier

I've manually added the stack offsets back as these are worth keeping - we really need a way for update_llc_test_checks.py not to mask out useful address math

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

5 years ago[DivRemPairs] Fixup DNDEBUG build - variable is only used in assertion
Roman Lebedev [Wed, 31 Jul 2019 12:26:37 +0000 (12:26 +0000)]
[DivRemPairs] Fixup DNDEBUG build - variable is only used in assertion

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

5 years agogn build: Merge r367393
Nico Weber [Wed, 31 Jul 2019 12:19:28 +0000 (12:19 +0000)]
gn build: Merge r367393

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

5 years ago[X86] Regenerate vp2intersect tests
Simon Pilgrim [Wed, 31 Jul 2019 12:17:10 +0000 (12:17 +0000)]
[X86] Regenerate vp2intersect tests

Enable nounwind to remove unnecessary stack manipulation code

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

5 years ago[DivRemPairs] Recommit: Handling for expanded-form rem - recomposition (PR42673)
Roman Lebedev [Wed, 31 Jul 2019 12:06:51 +0000 (12:06 +0000)]
[DivRemPairs] Recommit: Handling for expanded-form rem - recomposition (PR42673)

Summary:
While `-div-rem-pairs` pass can decompose rem in div+rem pair when div-rem pair
is unsupported by target, nothing performs the opposite fold.
We can't do that in InstCombine or DAGCombine since neither of those has access to TTI.
So it makes most sense to teach `-div-rem-pairs` about it.

If we matched rem in expanded form, we know we will be able to place div-rem pair
next to each other so we won't regress the situation.
Also, we shouldn't decompose rem if we matched already-decomposed form.
This is surprisingly straight-forward otherwise.

The original patch was committed in rL367288 but was reverted in rL367289
because it exposed pre-existing RAUW issues in internal data structures
of the pass; those now have been addressed in a previous patch.

https://bugs.llvm.org/show_bug.cgi?id=42673

Reviewers: spatel, RKSimon, efriedma, ZaMaZaN4iK, bogner

Reviewed By: bogner

Subscribers: bogner, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D65298

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

5 years ago[DivRemPairs] Avoid RAUW pitfalls (PR42823)
Roman Lebedev [Wed, 31 Jul 2019 12:06:38 +0000 (12:06 +0000)]
[DivRemPairs] Avoid RAUW pitfalls (PR42823)

Summary:
`DivRemPairs` internally creates two maps:
* {sign, divident, divisor} -> div instruction
* {sign, divident, divisor} -> rem instruction
Then it iterates over rem map, and looks if there is an entry
in div map with the same key. Then depending on some internal logic
it may RAUW rem instruction with something else.

But if that rem instruction is an input to other div/rem,
then it was used as a key in these maps, so the old value (used in key)
is now dandling, because RAUW didn't update those maps.
And we can't even RAUW map keys in general, there's `ValueMap`,
but we don't have a single `Value` as key...

The bug was discovered via D65298, and the test there exists.
Now, i'm not sure how to expose this issue in trunk.
The bug is clearly there if i change the map keys to be `AssertingVH`/`PoisoningVH`,
but i guess this didn't miscompiled anything thus far?
I really don't think this is benin without that patch.

The fix is actually rather straight-forward - instead of trying to somehow
shoe-horn `ValueMap` here (doesn't fit, key isn't just `Value`), or writing a new
`ValueMap` with key being a struct of `Value`s, we can just have an intermediate
data structure - a vector, each entry containing matching `Div, Rem` pair,
and pre-filling it before doing any modifications.
This way we won't need to query map after doing RAUW, so no bug is possible.

Reviewers: spatel, bogner, RKSimon, craig.topper

Reviewed By: spatel

Subscribers: hiraditya, hans, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D65451

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

5 years ago[DivRemPairs][NFC] Autogenerate all checklines
Roman Lebedev [Wed, 31 Jul 2019 12:06:16 +0000 (12:06 +0000)]
[DivRemPairs][NFC] Autogenerate all checklines

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

5 years ago[X86][AVX] Add reduced test case for PR42833
Simon Pilgrim [Wed, 31 Jul 2019 11:35:01 +0000 (11:35 +0000)]
[X86][AVX] Add reduced test case for PR42833

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

5 years agoRe-disable C4324 MSVC warning that was enabled in D65458 / rL367383
Simon Pilgrim [Wed, 31 Jul 2019 11:06:05 +0000 (11:06 +0000)]
Re-disable C4324 MSVC warning that was enabled in D65458 / rL367383

This was breaking /WX builds

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

5 years ago[ARM] Generate MVE VFMAs
Oliver Cruickshank [Wed, 31 Jul 2019 10:44:11 +0000 (10:44 +0000)]
[ARM] Generate MVE VFMAs

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

5 years ago[NFC] Test Commit
Oliver Cruickshank [Wed, 31 Jul 2019 10:08:09 +0000 (10:08 +0000)]
[NFC] Test Commit

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

5 years agoFix mismatching vector type in AlignmentTest.cpp
Guillaume Chatelet [Wed, 31 Jul 2019 10:00:48 +0000 (10:00 +0000)]
Fix mismatching vector type in AlignmentTest.cpp

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

5 years ago[RISCV] Support 'f' Inline Assembly Constraint
Sam Elliott [Wed, 31 Jul 2019 09:45:55 +0000 (09:45 +0000)]
[RISCV] Support 'f' Inline Assembly Constraint

Summary:
This adds the 'f' inline assembly constraint, as supported by GCC. An
'f'-constrained operand is passed in a floating point register. Exactly
which kind of floating-point register (32-bit or 64-bit) is decided
based on the operand type and the available standard extensions (-f and
-d, respectively).

This patch adds support in both the clang frontend, and LLVM itself.

Reviewers: asb, lewis-revill

Reviewed By: asb

Subscribers: hiraditya, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, kito-cheng, shiva0217, jrtc27, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, Jim, s.egerton, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D65500

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

5 years ago[NFC][ARMCGP] Use switch in isSupportedValue
Sam Parker [Wed, 31 Jul 2019 09:34:11 +0000 (09:34 +0000)]
[NFC][ARMCGP] Use switch in isSupportedValue

Use a switch instead of many isa<> while checking for supported
values. Also be explicit about which cast instructions are supported;
This allows the removal of SIToFP from GenerateSignBits.

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

5 years agoRecommit "[GVN] Preserve loop related analysis/canonical forms."
Florian Hahn [Wed, 31 Jul 2019 09:27:54 +0000 (09:27 +0000)]
Recommit "[GVN] Preserve loop related analysis/canonical forms."

This fixes some pipeline tests.
This reverts commit d0b6f42936bfb6d56d325c732ae79400c9c6016a.

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

5 years agoAdd default constructor for MaybeAlign
Guillaume Chatelet [Wed, 31 Jul 2019 09:16:24 +0000 (09:16 +0000)]
Add default constructor for MaybeAlign

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

5 years ago[AArch64][SVE2] Load/store instruction fixes
Cullen Rhodes [Wed, 31 Jul 2019 09:10:36 +0000 (09:10 +0000)]
[AArch64][SVE2] Load/store instruction fixes

Summary:
* Loads and stores in SVE2 are gather/scatter not contiguous, fixed by
  renaming multiclasses to reflect this and also updated comments.
* Remove aliases from load/store multiclasses that reflect the behaviour
  of the original form.
* Fix bug in scatter store implementation, vector list should be used as
  input, not output.

Reviewed By: sdesmalen

Differential Revision: https://reviews.llvm.org/D65392

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

5 years ago[RISCV] Add support for lowering floating point inlineasm clobbers
Simon Cook [Wed, 31 Jul 2019 09:07:21 +0000 (09:07 +0000)]
[RISCV] Add support for lowering floating point inlineasm clobbers

This adds the required extension to RISC-V's getRegForInlineAsmConstraint
in order to be able to correctly distringuish between the 32 and 64-bit
floating point registers when the generic fX name appears in inlineasm
clobber contraints. It also adds a check to validate that callee saved
floating point registers are only saved in this case when a hard-float
ABI is selected.

Differential Revision: https://reviews.llvm.org/D64751

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

5 years ago[AArch64][SVE2] Minor refactoring and cleanup
Cullen Rhodes [Wed, 31 Jul 2019 08:58:16 +0000 (08:58 +0000)]
[AArch64][SVE2] Minor refactoring and cleanup

Summary:
* Clarify comment with SVE2 for predicated shifts and move next to other
  shift instructions.
* Clarify comments for various instructions.
* Move FCVTX instruction next to other fp conversions.
* Move FLOGB to next to other fp instructions and fix description.
* Remove "cons" from non-constructive multiclass for bitwise shift-right
  and accumulate instructions.

Reviewed By: sdesmalen

Differential Revision: https://reviews.llvm.org/D65390

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

5 years ago[docs] Add cmake to Software requirements
Diana Picus [Wed, 31 Jul 2019 08:48:36 +0000 (08:48 +0000)]
[docs] Add cmake to Software requirements

Add cmake to the list of packages required for compiling LLVM.
Also move make to the bottom of the list and mark it as optional.

Differential Revision: https://reviews.llvm.org/D65438

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

5 years ago[AArch64][SVE2] Use destination register as source register
Cullen Rhodes [Wed, 31 Jul 2019 08:45:57 +0000 (08:45 +0000)]
[AArch64][SVE2] Use destination register as source register

Summary:
This patch fixes a bug in the following instructions that should have been
implemented as destructive. A destructive instruction is an instruction where
one of the source registers also acts as the destination register. Therefore,
the contents of the source register, when the instruction begins execution, are
replaced by the result of the instruction when the instruction completes
execution [1]:

  * SRI/SLI
  * EORBT/EORTB
  * TBX
  * Narrowing top instructions
  * FP convert precision instructions

These changes are non-functional from the assembler/diassembler point-of-view
but are necessary for correct codegen.

[1] https://static.docs.arm.com/ddi0584/ae/DDI0584A_e_SVE_supp_armv8A.pdf

Reviewed By: sdesmalen

Differential Revision: https://reviews.llvm.org/D65389

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

5 years ago[LLVM][NFC] Adding an Alignment type to LLVM
Guillaume Chatelet [Wed, 31 Jul 2019 08:27:42 +0000 (08:27 +0000)]
[LLVM][NFC] Adding an Alignment type to LLVM

Summary:
This patch introduces a type to straighten LLVM's alignment management.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html

The next step is to use this type throughout LLVM

Reviewers: jfb, jakehehrlich

Subscribers: mgorny, mgrang, dexonsmith, llvm-commits, courbet

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D64790

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

5 years ago[llvm/Object] - Add a test for "empty string table" error.
George Rimar [Wed, 31 Jul 2019 08:12:01 +0000 (08:12 +0000)]
[llvm/Object] - Add a test for "empty string table" error.

This error was never tested. In this patch I improved
the error message, added the test case and also simplified
the code that processes a similar error right below.

Differential revision: https://reviews.llvm.org/D65396

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

5 years ago[ARM][ParallelDSP] Convert to function pass
Sam Parker [Wed, 31 Jul 2019 07:32:03 +0000 (07:32 +0000)]
[ARM][ParallelDSP] Convert to function pass

Run across a whole function, visiting each basic block one at a time.

Differential Revision: https://reviews.llvm.org/D65324

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

5 years agorevert r367382 because buildbot failure
Zi Xuan Wu [Wed, 31 Jul 2019 07:03:42 +0000 (07:03 +0000)]
revert r367382 because buildbot failure

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

5 years ago[NFC] Remove LLVM_ALIGNAS
JF Bastien [Wed, 31 Jul 2019 03:22:08 +0000 (03:22 +0000)]
[NFC] Remove LLVM_ALIGNAS

Summary: The minimum compilers support all have alignas, and we don't use LLVM_ALIGNAS anywhere anymore. This also removes an MSVC diagnostic which, according to the comment above, isn't relevant anymore.

Reviewers: rnk

Subscribers: mgorny, jkorous, dexonsmith, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D65458

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

5 years ago[PowerPC] Eliminate loads/swap feeding swap/store for vector type by using big-endian...
Zi Xuan Wu [Wed, 31 Jul 2019 02:56:00 +0000 (02:56 +0000)]
[PowerPC] Eliminate loads/swap feeding swap/store for vector type by using big-endian load/store

In PowerPC, there is instruction to load vector in big endian element order when it's in little endian target.
So we can combine vector load + reverse into big endian load to eliminate the swap instruction.
Also combine vector reverse + store into big endian store.

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

5 years ago[AMDGPU] Fix high occupancy calculation and print it
Stanislav Mekhanoshin [Wed, 31 Jul 2019 01:07:10 +0000 (01:07 +0000)]
[AMDGPU] Fix high occupancy calculation and print it

We had couple places which still return 10 as a maximum
occupancy. Fixed.

Also print comment about occupancy as compiler see it.

Differential Revision: https://reviews.llvm.org/D65423

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

5 years agoGlobalISel: Replace artifact combiner checks with assert
Matt Arsenault [Wed, 31 Jul 2019 00:30:37 +0000 (00:30 +0000)]
GlobalISel: Replace artifact combiner checks with assert

It has bothered me for a while that these guard against cases that
should never happene, so replace these with asserts.

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

5 years ago[MS] Emit S_HEAPALLOCSITE debug info in SelectionDAG
Amy Huang [Wed, 31 Jul 2019 00:16:13 +0000 (00:16 +0000)]
[MS] Emit S_HEAPALLOCSITE debug info in SelectionDAG

Summary: This emits labels around heapallocsite calls in SelectionDAG.

Reviewers: rnk

Subscribers: MatzeB, aprantl, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D61105

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

5 years agoTableGen: Add MinAlignment predicate
Matt Arsenault [Wed, 31 Jul 2019 00:14:43 +0000 (00:14 +0000)]
TableGen: Add MinAlignment predicate

AMDGPU uses some custom code predicates for testing alignments.

I'm still having trouble comprehending the behavior of predicate bits
in the PatFrag hierarchy. Any attempt to abstract these properties
unexpectdly fails to apply them.

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

5 years agoReland: [Remarks] Add an LLVM-bitstream-based remark serializer
Francis Visoiu Mistrih [Wed, 31 Jul 2019 00:13:51 +0000 (00:13 +0000)]
Reland: [Remarks] Add an LLVM-bitstream-based remark serializer

Add a new serializer, using a binary format based on the LLVM bitstream
format.

This format provides a way to serialize the remarks in two modes:

1) Separate mode: the metadata is separate from the remark entries.
2) Standalone mode: the metadata and the remark entries are in the same
file.

The format contains:

* a meta block: container version, container type, string table,
external file path, remark version
* a remark block: type, remark name, pass name, function name, debug
file, debug line, debug column, hotness, arguments (key, value, debug
file, debug line, debug column)

A string table is required for this format, which will be dumped in the
meta block to be consumed before parsing the remark blocks.

On clang itself, we noticed a size reduction of 13.4x compared to YAML,
and a compile-time reduction of between 1.7% and 3.5% on CTMark.

Differential Revision: https://reviews.llvm.org/D63466

Original llvm-svn: 367364
Revert llvm-svn: 367370

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

5 years agoRevert "[Remarks] Add an LLVM-bitstream-based remark serializer"
Francis Visoiu Mistrih [Wed, 31 Jul 2019 00:01:34 +0000 (00:01 +0000)]
Revert "[Remarks] Add an LLVM-bitstream-based remark serializer"

This reverts commit r367364.

Breaks some bots: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-gn/builds/3161/steps/annotate/logs/stdio

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

5 years agoGlobalISel: Add G_ATOMICRMW_{FADD|FSUB}
Matt Arsenault [Tue, 30 Jul 2019 23:56:30 +0000 (23:56 +0000)]
GlobalISel: Add G_ATOMICRMW_{FADD|FSUB}

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

5 years agogn build: Merge r367364
Nico Weber [Tue, 30 Jul 2019 23:38:09 +0000 (23:38 +0000)]
gn build: Merge r367364

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

5 years ago[DAGCombiner] Add an option to control whether or not to enable store merging.
Wei Mi [Tue, 30 Jul 2019 23:14:56 +0000 (23:14 +0000)]
[DAGCombiner] Add an option to control whether or not to enable store merging.

Add an option to control whether or not to enable store merging in dag combiner
so we can workaround some bugs more easily.

Differential Revision: https://reviews.llvm.org/D65482

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

5 years ago[Remarks] Add an LLVM-bitstream-based remark serializer
Francis Visoiu Mistrih [Tue, 30 Jul 2019 23:11:57 +0000 (23:11 +0000)]
[Remarks] Add an LLVM-bitstream-based remark serializer

Add a new serializer, using a binary format based on the LLVM bitstream
format.

This format provides a way to serialize the remarks in two modes:

1) Separate mode: the metadata is separate from the remark entries.
2) Standalone mode: the metadata and the remark entries are in the same
file.

The format contains:

* a meta block: container version, container type, string table,
external file path, remark version
* a remark block: type, remark name, pass name, function name, debug
file, debug line, debug column, hotness, arguments (key, value, debug
file, debug line, debug column)

A string table is required for this format, which will be dumped in the
meta block to be consumed before parsing the remark blocks.

On clang itself, we noticed a size reduction of 13.4x compared to YAML,
and a compile-time reduction of between 1.7% and 3.5% on CTMark.

Differential Revision: https://reviews.llvm.org/D63466

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

5 years agoRemove cmake checks for MSVC 1900 / VS 2013
Reid Kleckner [Tue, 30 Jul 2019 22:49:11 +0000 (22:49 +0000)]
Remove cmake checks for MSVC 1900 / VS 2013

Our minimum Visual C++ version is 19.10 from Visual Studio 2017.

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

5 years ago[NFC] Improve cmake diagnostic when checking atomics
JF Bastien [Tue, 30 Jul 2019 22:08:38 +0000 (22:08 +0000)]
[NFC] Improve cmake diagnostic when checking atomics

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

5 years ago[X86] Fix mistake in comment. NFC
Craig Topper [Tue, 30 Jul 2019 21:00:24 +0000 (21:00 +0000)]
[X86] Fix mistake in comment. NFC

The code is matching sext not zext.

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

5 years ago[benchmark] Fix win32 link on case-sensitive fs
Roman Lebedev [Tue, 30 Jul 2019 20:47:59 +0000 (20:47 +0000)]
[benchmark] Fix win32 link on case-sensitive fs

Summary: This fixes cross-builds with MinGW from case-sensitive file-systems (on Linux)

This is a cherry-pick from
https://github.com/google/benchmark/pull/840
https://github.com/google/benchmark/commit/8e48105d465c586068dd8e248fe75a8971c6ba3a

Original patch by: @jschueller (Julien Schueller) !

Differential Revision: https://reviews.llvm.org/D61371

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

5 years ago[AMDGPU] Print register pressure for agpr and vgpr separately
Stanislav Mekhanoshin [Tue, 30 Jul 2019 20:45:15 +0000 (20:45 +0000)]
[AMDGPU] Print register pressure for agpr and vgpr separately

Differential Revision: https://reviews.llvm.org/D65476

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

5 years ago[MemorySSA] Extend allowed behavior for simplified instructions.
Alina Sbirlea [Tue, 30 Jul 2019 20:10:33 +0000 (20:10 +0000)]
[MemorySSA] Extend allowed behavior for simplified instructions.

Summary:
LoopRotate may simplify instructions, leading to the new instructions not having memory accesses created for them.
Allow this behavior, by allowing the new access to be null when the template is null, and looking upwards for the proper defined access when dealing with simplified instructions.

Reviewers: george.burgess.iv

Subscribers: jlebar, Prazek, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D65338

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

5 years ago[NVPTX] Fix PR41651
Michael Liao [Tue, 30 Jul 2019 19:52:01 +0000 (19:52 +0000)]
[NVPTX] Fix PR41651

Summary:
- Use the passed `DL` directly as retrieving data layout from CS by
  checking the called function is not reliable. Under indirect function
  call, there is no called function.

Subscribers: jholewinski, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D65468

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

5 years ago[dsymutil] Pass LinkOptions by value instead of const ref.
Jonas Devlieghere [Tue, 30 Jul 2019 19:34:26 +0000 (19:34 +0000)]
[dsymutil] Pass LinkOptions by value instead of const ref.

When looping over the difference architectures in a fat binary, we
modify the link options before dispatching the link step to a different
thread. Passing the options by cont reference is not thread safe, as we
might modify its fields before the whole sturct is copied over.

Given that the link options are already stored in the DwarfLinker, we
can easily fix this by passing a copy of the link options instead of a
reference, which would just get copied later on.

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

5 years ago[AMDGPU] Reserve all AGPRs on targets which do not have them
Stanislav Mekhanoshin [Tue, 30 Jul 2019 19:29:33 +0000 (19:29 +0000)]
[AMDGPU] Reserve all AGPRs on targets which do not have them

Differential Revision: https://reviews.llvm.org/D65471

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

5 years ago[AMDGPU/GlobalISel] Add llvm.amdgcn.fdiv.fast legalization.
Austin Kerbow [Tue, 30 Jul 2019 18:49:16 +0000 (18:49 +0000)]
[AMDGPU/GlobalISel] Add llvm.amdgcn.fdiv.fast legalization.

Reviewers: arsenm

Reviewed By: arsenm

Subscribers: volkan, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, rovka, dstuttard, tpr, t-tye, hiraditya, Petar.Avramovic, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D64966

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

5 years ago[FunctionAttrs] Annotate "willreturn" for AssumeLikeInst
Hideto Ueno [Tue, 30 Jul 2019 18:35:29 +0000 (18:35 +0000)]
[FunctionAttrs] Annotate "willreturn" for AssumeLikeInst

Summary:
In D37215, AssumeLikeInstruction are regarded as `willreturn`. In this patch, annotation is added to those which don't have `willreturn` now(`sideeffect, object_size, experimental_widenable_condition`).

Reviewers: jdoerfert, nikic, sstefan1

Reviewed By: nikic

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D65455

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

5 years agogn build: Update comment I failed to update in r367340 / D65462
Nico Weber [Tue, 30 Jul 2019 18:19:13 +0000 (18:19 +0000)]
gn build: Update comment I failed to update in r367340 / D65462

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

5 years agogn build: Fix check-clang-tools after r362702.
Nico Weber [Tue, 30 Jul 2019 18:16:55 +0000 (18:16 +0000)]
gn build: Fix check-clang-tools after r362702.

r362702 added a test that requires clang-tidy to be linked
into libclang, so add that to the gn build.

Differential Revision: https://reviews.llvm.org/D65462

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