185311 Commits

Author SHA1 Message Date
Benjamin Kramer
076e31e099 [ADT] Make DenseMap use allocate_buffer
This unlocks some goodies like sized deletion and gets the alignment
right on platforms that chose to provide a lower default new alignment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371846 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-13 12:32:40 +00:00
James Henderson
7563f172e2 [llvm-size] Fix spelling errors (Berkely -> Berkeley)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371845 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-13 12:00:42 +00:00
Benjamin Kramer
e8e4b1ed55 [Orc] Roll back ThreadPool to std::function
MSVC doesn't allow move-only types in std::packaged_task. Boo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371844 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-13 11:59:51 +00:00
Benjamin Kramer
3642ab247c [Orc] Address the remaining move-capture FIXMEs
This required spreading unique_function a bit more, which I think is a
good thing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371843 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-13 11:35:33 +00:00
Simon Pilgrim
5cceed3a2e [X86] negateFMAOpcode - extend to support FMADDSUB/FMSUBADD and output negation. NFCI.
Some prep work for PR42863, this change allows us to move all the FMA opcode mappings into the negateFMAOpcode helper.

For the FMADDSUB/FMSUBADD cases, we can only negate the accumulator - any other negations will result in an error.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371840 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-13 11:22:40 +00:00
David Green
a1571b7697 [ARM] Add earlyclobber for cross beat MVE instructions
rL367544 added @earlyclobbers for the MVE VREV64 instruction. This adds the
same for a number of other 32bit instructions that are similarly unpredictable
if the destination equals the source (due to the cross beat nature of the
instructions).
This includes:
  VCADD.f32
  VCADD.i32
  VCMUL.f32
  VHCADD.s32
  VMULLT/B.s/u32
  VQDMLADH{X}.s32
  VQRDMLADH{X}.s32
  VQDMLSDH{X}.s32
  VQRDMLSDH{X}.s32
  VQDMULLT/B.s32 with Qm and Rm

No tests here as this would require intrinsics (or very interesting codegen) to
manifest. The tests will follow naturally as the intrinsics are added.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371838 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-13 11:20:17 +00:00
Nandor Licker
70adb95bf9 [Clang Interpreter] Initial patch for the constexpr interpreter
Summary:
This patch introduces the skeleton of the constexpr interpreter,
capable of evaluating a simple constexpr functions consisting of
if statements. The interpreter is described in more detail in the
RFC. Further patches will add more features.

Reviewers: Bigcheese, jfb, rsmith

Subscribers: bruno, uenoku, ldionne, Tyker, thegameg, tschuett, dexonsmith, mgorny, cfe-commits

Tags: #clang

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371834 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-13 09:46:16 +00:00
Sjoerd Meijer
4a41085754 [AArch64] More @llvm.fma.f16 tests
Follow up of rL371321 that added FMA FP16 patterns. This adds more tests
for @llvm.fma.f16. This probably shows we miss one fmsub optimisation
opportunity, which I will look into.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371833 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-13 09:44:13 +00:00
Guillaume Chatelet
171a74f197 [Alignment] Introduce llvm::Align to MCSection
Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet, JDevlieghere

Subscribers: arsenm, sdardis, jvesely, nhaehnle, sbc100, hiraditya, aheejin, jrtc27, atanasyan, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371831 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-13 09:29:59 +00:00
George Rimar
d72c6b06ee [lib/ObjectYAML] - Change interface to return bool instead of int. NFCI
It was suggested in comments for D67445 to split this part.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371828 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-13 09:12:38 +00:00
Sam Tebbs
8776b6cc6d [ARM] Add support for MVE vmaxv and vminv
This patch adds vecreduce_smax, vecredude_umax, vecreduce_smin, vecreduce_umin and selection for vmaxv and minv.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371827 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-13 09:11:46 +00:00
George Rimar
9b7a447e5a [llvm-objdump] Fix llvm-objdump --all-headers output order
Patch by Justice Adams!

Made llvm-objdump --all-headers output match the order of GNU objdump for compatibility reasons.

Old order of the headers output:
* file header
* section header table
* symbol table
* program header table
* dynamic section

New order of the headers output (GNU compatible):
* file header information
* program header table
* dynamic section
* section header table
* symbol table

(Relevant BugZilla Bug: https://bugs.llvm.org/show_bug.cgi?id=41830)

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371826 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-13 08:56:28 +00:00
Dmitri Gribenko
e7c377e21f Revert "Fix test failures after r371640"
This reverts commit r371645, because r371640 was reverted.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371824 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-13 08:26:59 +00:00
Florian Hahn
768257cad5 [BasicBlockUtils] Add optional BBName argument, in line with BB:splitBasicBlock
Reviewers: spatel, asbirlea, craig.topper

Reviewed By: asbirlea

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371819 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-13 08:03:32 +00:00
Sjoerd Meijer
8eeaa07c97 [AArch64] MachineCombiner FMA matching. NFC.
Follow-up of rL371321 that added some more FP16 FMA patterns, and an attempt to
reduce the copy-pasting and make this more readable.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371818 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-13 07:38:54 +00:00
Craig Topper
96b3b7ad39 [TargetRegisterInfo] Remove SVT argument from getCommonSubClass.
This was added to support fp128 on x86-64, but appears to be
unneeded now. This may be because the FR128 register class
added back then was merged with the VR128 register class later.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371815 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-13 05:24:37 +00:00
Matt Arsenault
e93fcf5684 AMDGPU/GlobalISel: Fix assert on multi-return side effect intrinsics
llvm.amdgcn.else hits this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371812 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-13 04:12:12 +00:00
Matt Arsenault
f00688b213 AMDGPU/GlobalISel: Legalize s32->s16 G_SITOFP/G_UITOFP
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371811 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-13 04:04:55 +00:00
Shiva Chen
6e5264ef03 [RISCV] Support stack offset exceed 32-bit for RV64
Differential Revision: https://reviews.llvm.org/D61884

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371810 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-13 04:03:32 +00:00
Shiva Chen
e1a0a6d1f2 Revert "[RISCV] Support stack offset exceed 32-bit for RV64"
This reverts commit 1c340c62058d4115d21e5fa1ce3a0d094d28c792.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371809 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-13 04:03:24 +00:00
Matt Arsenault
68c7c7683b AMDGPU/GlobalISel: Fix RegBankSelect for amdgcn.else
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371808 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-13 03:55:49 +00:00
Matt Arsenault
259954721b AMDGPU/GlobalISel: Select 16-bit VALU bit ops
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371807 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-13 03:55:43 +00:00
Shiva Chen
1c340c6205 [RISCV] Support stack offset exceed 32-bit for RV64
Differential Revision: https://reviews.llvm.org/D61884

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371806 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-13 02:50:13 +00:00
Matt Arsenault
8fc9eed989 AMDGPU/GlobalISel: Legalize G_FFLOOR
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371803 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-13 01:48:15 +00:00
Tim Shen
afadd2da10 Temporarily revert r371640 "LiveIntervals: Split live intervals on multiple dead defs".
It reveals a miscompile on Hexagon. See PR43302 for details.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371802 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-13 01:34:25 +00:00
Matt Arsenault
bf6eeaf07e AMDGPU/GlobalISel: Legalize G_FMAD
Unlike SelectionDAG, treat this as a normally legalizable operation.
In SelectionDAG this is supposed to only ever formed if it's legal,
but I've found that to be restricting. For AMDGPU this is contextually
legal depending on whether denormal flushing is allowed in the use
function.

Technically we currently treat the denormal mode as a subtarget
feature, so custom lowering could be avoided. However I consider this
to be a defect, and this should be contextually dependent on the
controllable rounding mode of the parent function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371800 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-13 00:44:35 +00:00
Matt Arsenault
bc76bf812b AMDGPU/GlobalISel: Select G_CTPOP
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371798 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-13 00:11:20 +00:00
Matt Arsenault
b62f354be8 DAG/GlobalISel: Correct type profile of bitcount ops
The result integer does not need to be the same width as the input.
AMDGPU, NVPTX, and Hexagon all have patterns working around the types
matching. GlobalISel defines these as being different type indexes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371797 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-13 00:11:14 +00:00
Matt Arsenault
9e9da6ad68 AMDGPU: Add immarg to llvm.amdgcn.init.exec.from.input
As far as I can tell this has to be a constant.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371793 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-12 23:46:54 +00:00
Matt Arsenault
b50690c7bb LiveIntervals: Remove assertion
This testcase is invalid, and caught by the verifier. For the verifier
to catch it, the live interval computation needs to complete. Remove
the assert so the verifier catches this, which is less confusing.

In this testcase there is an undefined use of a subregister, and lanes
which aren't used or defined. An equivalent testcase with the
super-register shrunk to have no untouched lanes already hit this
verifier error.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371792 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-12 23:46:51 +00:00
Matt Arsenault
3360813c03 AMDGPU: Inline constant when materalizing FI with add on gfx9
This was relying on the SGPR usable for the carry out clobber to also
be used for the input. There was no carry out on gfx9. With no carry
out clobber to worry about, so the literal can just be directly used
with a VOP2 add.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371791 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-12 23:46:46 +00:00
Philip Reames
8fb3b56963 [Test] Restructure check lines to show differences between modes more clearly
With the landing of the previous patch (in particular D66318) there are a lot fewer diffs now.  I added an experimental O0 line, and updated all the tests to group experimental and non-experimental O0/O3 together.

Skimming the remaining diffs, there's only a few which are obviously incorrect.  There's a large number which are questionable, so more todo.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371790 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-12 23:22:37 +00:00
Philip Reames
164b5eddc0 Rename nonvolatile_load/store to simple_load/store [NFC]
Implement the TODO from D66318.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371789 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-12 23:03:39 +00:00
Jessica Paquette
a5e10524ac [AArch64][GlobalISel] Support tail calling with swiftself parameters
Swiftself uses a callee-saved register. We can tail call when the register used
in the caller and callee is the same.

This behaviour is equivalent to that in `TargetLowering::parametersInCSRMatch`.

Update call-translator-tail-call.ll to verify that we can do this. When we
support inline assembly, we can write a check similar to the one in the
general swiftself.ll. For now, we need to verify that we get the correct COPY
instruction after call lowering.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371788 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-12 23:00:59 +00:00
Philip Reames
11df0bc741 [SDAG] Update generic code to conservatively check for isAtomic in addition to isVolatile
This is the first sweep of generic code to add isAtomic bailouts where appropriate. The intention here is to have the switch from AtomicSDNode to LoadSDNode/StoreSDNode be close to NFC; that is, I'm not looking to allow additional optimizations at this time. That will come later.  See D66309 for context.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371786 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-12 22:49:17 +00:00
Greg Clayton
4736324188 [NFC] Fix file header filename to be Range.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371783 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-12 22:23:03 +00:00
DeForest Richards
9d1e305884 [Docs] Adds page for reference docs
Adds a Reference Documentation page for LLVM and API reference documentation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371782 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-12 22:17:04 +00:00
Jessica Paquette
f75129d2f5 [AArch64][GlobalISel] Support sibling calls with outgoing arguments
This adds support for lowering sibling calls with outgoing arguments.

e.g

```
define void @foo(i32 %a)
```

Support is ported from AArch64ISelLowering's `isEligibleForTailCallOptimization`.
The only thing that is missing is a full port of
`TargetLowering::parametersInCSRMatch`. So, if we're using swiftself,
we'll never tail call.

- Rename `analyzeCallResult` to `analyzeArgInfo`, since the function is now used
  for both outgoing and incoming arguments
- Teach `OutgoingArgHandler` about tail calls. Tail calls use frame indices for
  stack arguments.
- Teach `lowerFormalArguments` to set the bytes in the caller's stack argument
  area. This is used later to check if the tail call's parameters will fit on
  the caller's stack.
- Add `areCalleeOutgoingArgsTailCallable` to perform the eligibility check on
  the callee's outgoing arguments.

For testing:

- Update call-translator-tail-call to verify that we can now tail call with
  outgoing arguments, use G_FRAME_INDEX for stack arguments, and respect the
  size of the caller's stack
- Remove GISel-specific check lines from speculation-hardening.ll, since GISel
  now tail calls like the other selectors
- Add a GISel test line to tailcall-string-rvo.ll since we can tail call in that
  test now
- Add a GISel test line to tailcall_misched_graph.ll since we tail call there
  now. Add specific check lines for GISel, since the debug output from the
  machine-scheduler differs with GlobalISel. The dependency still holds, but
  the output comes out in a different order.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371780 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-12 22:10:36 +00:00
Craig Topper
31bf9d4967 [PowerPC] Remove the SPE4RC register class and instead add f32 to the GPRC register class.
Summary:
Since the SPE4RC register class contains an identical set of registers
and an identical spill size to the GPRC class its slightly confusing
the tablegen emitter. It's preventing the GPRC_and_GPRC_NOR0 synthesized
register class from inheriting VTs and AltOrders from GPRC or GPRC_NOR0.
This is because SPE4C is found first in the super register class list
when inheriting these properties and it doesn't set the VTs or
AltOrders the same way as GPRC or GPRC_NOR0.

This patch replaces all uses of GPE4RC with GPRC and allows GPRC and
GPRC_NOR0 to contain f32.

The test changes here are because the AltOrders are being inherited
to GPRC_NOR0 now.

Found while trying to determine if getCommonSubClass needs to take
a VT argument. It was originally added to support fp128 on x86-64,
I've changed some things about that so that it might be needed
anymore. But a PowerPC test crashed without it and I think its
due to this subclass issue.

Reviewers: jhibbits, nemanjai, kbarton, hfinkel

Subscribers: wuzish, nemanjai, mehdi_amini, hiraditya, kbarton, MaskRay, dexonsmith, jsji, shchenz, steven.zhang, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371779 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-12 22:07:35 +00:00
Philip Reames
3c63e9245b Remove a duplicate test
Turns out I'd already added exactly the same test under the name non_unit_stride.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371777 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-12 21:40:15 +00:00
Philip Reames
3cd2be9b6d [SCEV] Add smin support to getRangeRef
We were failing to compute trip counts (both exact and maximum) for any loop which involved a comparison against either an umin or smin. It looks like this simply got missed when we added smin/umin to SCEV.  (Note: umin was submitted separately earlier today.  Turned out two folks hit this at the same time.)

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371776 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-12 21:32:27 +00:00
Craig Topper
9b2725ea53 [DAGCombiner][X86] Pass the CmpOpVT to reduceSelectOfFPConstantLoads so X86 can exclude fp128 compares.
The X86 decision assumes the compare will produce a result in an XMM
register, but that can't happen for an fp128 compare since those
go to a libcall the returns an i32. Pass the VT so X86 can check
the type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371775 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-12 21:30:18 +00:00
Evandro Menezes
a53ef73293 [ConstantFolding] Expand folding of some library functions
Expanding the folding of `nearbyint()`, `rint()` and `trunc()` to library
functions, in addition to the current support for intrinsics.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371774 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-12 21:23:22 +00:00
Tim Shen
c77b243d05 Fix llvm-reduce tests so that they don't assume the source code is
writable.

Instead of copying over the original file permissions, just create
a new file and add the executable bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371772 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-12 21:03:49 +00:00
Craig Topper
8e47cb6b6e [SelectionDAGBuilder] Simplify loop in visitSelect back to how it was before r255558.
This code was changed to accomodate fp128 being softened to itself
during type legalization on x86-64. This was done in order to create
libcalls while having fp128 as a legal type. We're now doing the
libcall creation during LegalizeDAG and the type legalization changes
to enable the old behavior have been removed. So this change to
SelectionDAGBuilder is no longer needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371771 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-12 21:00:32 +00:00
Simon Pilgrim
de5a9d636b [X86] Move negateFMAOpcode helper earlier to help future patch. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371770 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-12 20:39:56 +00:00
Florian Hahn
a9994f8207 [LV] Update test case after r371768.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371769 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-12 20:07:17 +00:00
Florian Hahn
9e6356994a [SCEV] Support SCEVUMinExpr in getRangeRef.
This patch adds support for SCEVUMinExpr to getRangeRef,
similar to the support for SCEVUMaxExpr.

Reviewers: sanjoy.google, efriedma, reames, nikic

Reviewed By: sanjoy.google

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371768 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-12 20:03:32 +00:00
David Blaikie
eed589befe llvm-reduce: For now, mark these tests as requiring a shell
(since they execute shell scripts/that's the only entry point at the
moment)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371764 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-12 19:50:54 +00:00
Philip Reames
9d92ef499f Precommit tests for D67514
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371762 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-12 19:34:27 +00:00