156880 Commits

Author SHA1 Message Date
Artem Belevich
42a6db53c8 Mark intrinsics operating on the whole warp as IntrInaccessibleMemOnly
It's needed to model the fact that they do access data from other threads in a
warp and thus can't be CSE'd.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318173 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-14 19:14:00 +00:00
Simon Dardis
7ce4fbb07c [mips] Simplify test for 5.0.1 (NFC)
Simplify testing that an emergency spill slot is used when MSA
is used so that it can be included in the 5.0.1 release.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318172 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-14 19:11:45 +00:00
Jake Ehrlich
168e9744a4 [llvm-objcopy] Add -strip-non-alloc option to remove all non-allocated sections
This change adds a new flag not present in GNU objcopy that we call
--strip-non-alloc.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318168 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-14 18:50:24 +00:00
Yaxun Liu
eb711fee66 CodeGen: Fix TargetLowering::LowerCallTo for sret value type
TargetLowering::LowerCallTo assumes that sret value type corresponds to a
pointer in default address space, which is incorrect, since sret value type
should correspond to a pointer in alloca address space, which may not
be the default address space. This causes assertion for amdgcn target
in amdgiz environment.

This patch fixes that.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318167 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-14 18:46:52 +00:00
Jake Ehrlich
2f8f8d46d2 [llvm-objcopy] Support the rest of the ELF formats
We haven't been supporting anything but ELF64LE since the start. Luckily
this was always accounted for and the change is pretty trivial. B35281
requests this change for ELF32LE. This change adds support for ELF32LE,
ELF64BE, and ELF32BE with all supported features that already existed
for ELF64LE.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318166 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-14 18:41:47 +00:00
Mandeep Singh Grang
154d2725d5 [PredicateInfo] Stable sort ValueDFS to remove non-deterministic ordering
Summary: This fixes failure in Transforms/Util/PredicateInfo/testandor.ll uncovered by D39245.

Reviewers: dberlin

Reviewed By: dberlin

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318165 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-14 18:22:50 +00:00
Mandeep Singh Grang
952372cb3b [XRay] Stable sort XRayRecord to remove non-deterministic ordering
Summary:
This fixes failure in tools/llvm-xray/X86/graph-zero-latency-calls.yaml
uncovered by D39245.

Reviewers: dberris

Reviewed By: dberris

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318163 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-14 18:11:08 +00:00
Serge Guelton
de9947478d Add missing const qualifier to AttributeSet::operator==
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318162 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-14 18:08:05 +00:00
Adam Nemet
cab430076b Adjust test after r318159
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318160 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-14 17:12:36 +00:00
Adam Nemet
d90634bed1 [llvm-profdata] Report if profile data file is IR- or FE-level
Differential Revision: https://reviews.llvm.org/D39997

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318159 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-14 16:59:18 +00:00
Craig Topper
fc109b02f4 [X86] Fix typo in comment. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318156 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-14 16:14:00 +00:00
Oliver Stannard
bf70e59718 [Docs] Add tablegen backend for target opcode documentation
This is a tablegen backend to generate documentation for the opcodes that exist
for each target. For each opcode, it lists the assembly string, the names and
types of all operands, and the flags and predicates that apply to the opcode.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318155 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-14 15:35:15 +00:00
Ilya Biryukov
3656d83960 Use input redirection in WebAssembly/comdat.ll test.
To match how the other tests do it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318153 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-14 14:26:42 +00:00
Simon Pilgrim
036d0280e0 [X86][AVX] Add scheduling test for vmovntdq 256-bit store
Needs to use inline asm as domain will otherwise be changed to float (vmovntps)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318151 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-14 14:03:29 +00:00
Gil Rapaport
c07df42b1a [LV] Introduce VPBlendRecipe, VPWidenMemoryInstructionRecipe
This patch is part of D38676.

The patch introduces two new Recipes to handle instructions whose vectorization
involves masking. These Recipes take VPlan-level masks in D38676, but still rely
on ILV's existing createEdgeMask(), createBlockInMask() in this patch.

VPBlendRecipe handles intra-loop phi nodes, which are vectorized as a sequence
of SELECTs. Its execute() code is refactored out of ILV::widenPHIInstruction(),
which now handles only loop-header phi nodes.

VPWidenMemoryInstructionRecipe handles load/store which are to be widened
(but are not part of an Interleave Group). In this patch it simply calls
ILV::vectorizeMemoryInstruction on execute().

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318149 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-14 12:09:30 +00:00
Tim Northover
cb6b828542 ARM: correctly update CFG when splitting BB to fix branch.
Because the block-splitting code is multi-purpose, we have to meddle with the
branches when using it to fixup a conditional branch destination. We got the
code right, but forgot to update the CFG so the verifier complained when
expensive checks were on.

Probably harmless since constant-islands comes so late, but best to fix it
anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318148 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-14 11:43:54 +00:00
Diana Picus
155567c8fe [ARM GlobalISel] Remove C++ code for G_CONSTANT
Get rid of the handwritten instruction selector code for handling
G_CONSTANT. This code wasn't checking all the preconditions correctly
anyway, so it's better to leave it to TableGen, which can handle at
least some cases correctly (e.g. MOVi, MOVi16, folding into binary
operations). Also add tests to cover those cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318146 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-14 11:20:32 +00:00
Momchil Velikov
a466503cd3 [ARM] Fix incorrect conversion of a tail call to an ordinary call
When we emit a tail call for Armv8-M, but then discover that the caller needs to
save/restore `LR`, we convert the tail call to an ordinary one, since restoring
`LR` takes extra instructions, which may negate the benefits of the tail
call. If the callee, however, takes stack arguments, this conversion is
incorrect, since nothing has been done to pass the stack arguments.

Thus the patch reverts https://reviews.llvm.org/rL294000

Also, we improve the instruction sequence for popping `LR` in the case when we
couldn't immediately find a scratch low register, but we can use as a temporary
one of the callee-saved low registers and restore `LR` before popping other
callee-saves.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318143 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-14 10:36:52 +00:00
Matt Arsenault
29f8977210 AMDGPU: Fix test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318138 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-14 06:40:00 +00:00
Adam Nemet
47a3615064 [opt-viewer] Truncate long remark text in source view
The table is changed to fixed layout[1] and the lines use ellipses if they
would overflow their cell.

[1] https://css-tricks.com/fixing-tables-long-strings/

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318136 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-14 04:48:18 +00:00
Adam Nemet
0c383f6a48 [opt-viewer] With hotness only show max 1000 entries on the index page
Adjustable with an option.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318135 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-14 04:37:32 +00:00
Dylan McKay
4f394eddf1 [AVR] Remove the select-mbb-placement-bug.ll test
This test was originally added when an old bug was fixed that caused
broken iterator code to break basic block placement.

The issue has an extremely low chance of every being a problem again.

This specific test is very flaky and fails often due to upstream
changes.

I have removed this test because it negates more value than it returns.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318134 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-14 04:32:49 +00:00
Matt Arsenault
556b1b79ec AMDGPU: Fix producing saveexec when the copy is spilled
If the register from the copy from exec was spilled,
the copy before the spill was deleted leaving a spill
of undefined register verifier error and miscompiling.
Check for other use instructions of the copy register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318132 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-14 02:16:54 +00:00
Chandler Carruth
8dd352a12f [PM] Port BoundsChecking to the new PM.
Registers it and everything, updates all the references, etc.

Next patch will add support to Clang's `-fexperimental-new-pass-manager`
path to actually enable BoundsChecking correctly.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318128 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-14 01:30:04 +00:00
Rafael Espindola
79f20d27db Use TempFile in llvm-ar. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318127 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-14 01:21:15 +00:00
Chandler Carruth
c3e65d9d3c [PM] Refactor BoundsChecking further to prepare it to be exposed both as
a legacy and new PM pass.

This essentially moves the class state to parameters and re-shuffles the
code to make that reasonable. It also does some minor cleanups along the
way and leaves some comments.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318124 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-14 01:13:59 +00:00
Sam Clegg
336b4883e2 [WebAssembly] Explicily disable comdat support for wasm output
For now at least.  We clearly need some kind of comdat or
linkonce_odr support for wasm but currently COMDAT is not
supported.

Disable COMDAT support in the same way we do the Mach-O.  This
also causes clang not to generated COMDATs.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318123 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-14 00:49:16 +00:00
Rafael Espindola
6765e2f47d Add a move assignment operator to TempFile. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318122 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-14 00:31:28 +00:00
Hans Wennborg
138434e367 Update some code.google.com links
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318115 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-13 23:47:58 +00:00
Zachary Turner
89cd192690 Revert "Update test_debuginfo.pl script to point to new tree location."
This reverts the aforementioned patch and 2 subsequent follow-ups,
as some buildbots are still failing 2 tests because of it.
Investigation is ongoing into the cause of the failures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318112 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-13 23:33:29 +00:00
Rafael Espindola
3348c6d20f Simplify and rename variable.
std::error_code can represent success, so we don't need a
Optional<std::error_code>.

Rename the variable to avoid confusion with the type Error.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318111 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-13 23:32:19 +00:00
Matt Arsenault
dde12849b2 AMDGPU: Fix not converting d16 load/stores to offset
Fixes missed optimization with new MUBUF instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318106 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-13 23:24:26 +00:00
Rafael Espindola
8658d31e24 Simplify. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318104 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-13 23:06:54 +00:00
Daniel Sanders
22434af3ad [tablegen] Handle atomic predicates for ordering inside tablegen. NFC.
Similar to r315841, GlobalISel and SelectionDAG require different code for the
common atomic predicates due to differences in the representation.
Even without that, differences in the IR (SDNode vs MachineInstr) require
differences in the C++ predicate.

This patch moves the implementation of the common atomic predicates related to
ordering into tablegen so that it can handle these differences.

It's NFC for SelectionDAG since it emits equivalent code and it's NFC for
GlobalISel since the rules involving the relevant predicates are still
rejected by the importer.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318102 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-13 23:03:47 +00:00
Matt Arsenault
12d09b0ded AMDGPU: Implement computeKnownBitsForTargetNode for mbcnt
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318100 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-13 22:55:05 +00:00
Daniel Sanders
438d60f1e7 [tablegen] Handle atomic predicates for memory type inside tablegen. NFC.
Similar to r315841, GlobalISel and SelectionDAG require different code for the
common atomic predicates due to differences in the representation.
Even without that, differences in the IR (SDNode vs MachineInstr) require
differences in the C++ predicate.

This patch moves the implementation of the common atomic predicates related to
memory type into tablegen so that it can handle these differences.

It's NFC for SelectionDAG since it emits equivalent code and it's NFC for
GlobalISel since the rules involving the relevant predicates are still
rejected by the importer.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318095 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-13 22:26:13 +00:00
Jake Ehrlich
ecb06411e6 [llvm-objcopy] Add --strip-debug
Many projects use this option. There are two ways to use it. You can
either a) Just use --strip-debug and keep the old file with debug
content or b) you can use --strip-debug, --only-keep-debug, and
--add-gnu-debuglink all in conjunction to create two separate files, the
stripped file and the debug file. --only-keep-debug is more complicated
than --strip-debug because it keeps the section headers without keeping
section contents. That's not really supported by llvm-objcopy at the
moment but I plan on adding it. So this change just supports a) and
options to support b) will come soon.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318094 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-13 22:13:08 +00:00
Jake Ehrlich
a722ab9759 [llvm-objcopy] Add --strip-all option to llvm-objcopy
This change adds a slightly less extreme form of stripping. It should
remove any section that starts with ".debug" and should remove any
symbol table or relocations. In general this strips out most of the
stuff you don't need to execute but leaves a number of things around.
This behavior has been designed to be compatible with GNU strip/objcopy
--strip-all so that anywhere you currently use --strip-all you should be
able to use llvm-objcopy as a drop in replacement.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318092 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-13 22:02:07 +00:00
Serge Guelton
f3d06a209d Fix -Werror when compiling rL318083 (ter)
Statically assert the result and remove a runtime comparison, a direct consequence of the optimization introduced in rL318083.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318091 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-13 21:55:01 +00:00
Serge Guelton
da0e1ff523 Fix -Werror when compiling rL318083 (bis)
Statically assert the result and remove a runtime comparison, a direct consequence of the optimization introduced in rL318083.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318090 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-13 21:40:57 +00:00
Serge Guelton
5aed538ef1 Fix -Werror when compiling rL318083
Statically assert the result and remove a runtime comparison, a direct consequence of the optimization introduced in rL318083.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318087 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-13 21:25:35 +00:00
Adrian Prantl
cfcc1f1c64 Fix an assertion in SelectionDAG::transferDbgValues()
when transferring debug info describing the lower bits of an extended SDNode.

rdar://problem/35504722

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318086 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-13 21:24:54 +00:00
Serge Guelton
1fd1611565 Reorder Value.def to optimize code size
If the first values in Value.def is the range of constant, then the code
generated by `isa<Constant>` is smaller by one operation (basically, an add is
removed). It turns out this small optimization reduces the size of the
statically linked clang binary by 400ko on my laptop. The theoritical
performance gain is non visible from my benchmarks, but the size dropdown is.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318083 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-13 20:57:40 +00:00
Evgeniy Stepanov
fbb029c5bb [arm] Fix Unnecessary reloads from GOT.
Summary:
This fixes PR35221.
Use pseudo-instructions to let MachineCSE hoist global address computation.

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318081 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-13 20:45:38 +00:00
Sanjay Patel
c7ea0c36fe [Reassociation] regenerate test checks; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318076 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-13 19:46:28 +00:00
Reid Kleckner
7983d3bb32 Fix clang -Wsometimes-uninitialized warning in SCEV code
I don't believe this was a problem in practice, as it's likely that the
boolean wasn't checked unless the backend condition was non-null.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318073 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-13 18:43:11 +00:00
Dinar Temirbulatov
461a9580a6 NFC, Allow SystemZ SLP tests only when SystemZ is supported.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318070 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-13 18:35:43 +00:00
Rafael Espindola
8adf022a73 Create a TempFile class.
This just adds a TempFile class and replaces the use in
FileOutputBuffer with it.

The only difference for now is better error handling. Followup work includes:

- Convert other user of temporary files to it.
- Add support for automatically deleting on windows.
- Add a createUnnamed method that returns a potentially unnamed
  file. It would be actually unnamed on modern linux and have a
  unknown name on windows.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318069 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-13 18:33:44 +00:00
Daniel Sanders
ed22c23692 [globalisel][tablegen] Add support for extload.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318068 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-13 18:30:23 +00:00
Petar Jovanovic
372866c87c fix printing of alias instructions by removing redundant spacing
Some alias instructions are printed with an extra space after the tab
character. Fix this by skipping that space when the tab character is printed
so that the instructions are aligned with the rest of the code.

Patch by Milos Stojanovic.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318059 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-13 18:00:24 +00:00