OSDN Git Service

android-x86/external-llvm.git
6 years ago[ARM, AArch64] Fix an assert message, Darwin isn't the only target supporting TLS...
Martin Storsjo [Tue, 14 Nov 2017 19:57:59 +0000 (19:57 +0000)]
[ARM, AArch64] Fix an assert message, Darwin isn't the only target supporting TLS. NFC.

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

6 years agoSimplify irreducible loop metadata test code.
Hiroshi Yamauchi [Tue, 14 Nov 2017 19:48:59 +0000 (19:48 +0000)]
Simplify irreducible loop metadata test code.

Summary:
Shorten the irreducible loop metadata test code by removing insignificant
instructions.

Reviewers: davidxl

Reviewed By: davidxl

Subscribers: llvm-commits

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

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

6 years ago[CodeGenPrepare] Disable div bypass when working set size is huge.
Easwaran Raman [Tue, 14 Nov 2017 19:31:51 +0000 (19:31 +0000)]
[CodeGenPrepare] Disable div bypass when working set size is huge.

Summary:
Bypass of slow divs based on operand values is currently disabled for
-Os. Do the same when profile summary is available and the working set
size of the application is huge. This is similar to how loop peeling is
guarded by hasHugeWorkingSetSize. In the div bypass case, the generated
extra code (and the extra branch) tendss to outweigh the benefits of the
bypass. This results in noticeable performance improvement on an
internal application.

Reviewers: davidxl

Subscribers: llvm-commits

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

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

6 years ago[SystemZ] Fix invalid codegen using RISBMux on out-of-range bits
Ulrich Weigand [Tue, 14 Nov 2017 19:20:46 +0000 (19:20 +0000)]
[SystemZ] Fix invalid codegen using RISBMux on out-of-range bits

Before using the 32-bit RISBMux set of instructions we need to
verify that the input bits are actually within range of the 32-bit
instruction.  This fixer PR35289.

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

6 years agoSet hasSideEffects=0 for TargetOpcode::{CFI_INSTRUCTION,EH_LABEL,GC_LABEL,ANNOTATION_...
Alex Bradbury [Tue, 14 Nov 2017 19:16:08 +0000 (19:16 +0000)]
Set hasSideEffects=0 for TargetOpcode::{CFI_INSTRUCTION,EH_LABEL,GC_LABEL,ANNOTATION_LABEL}

D37065 (committed as rL317674) explicitly set hasSideEffects for all
TargetOpcode::* instructions where it was inferred previously. This is a
follow-up to that patch, setting hasSideEffects=0 for CFI_INSTRUCTION,
EH_LABEL, GC_LABEL and ANNOTATION_LABEL. All LLVM tests pass after this
change.

This patch also modifies MachineInstr::isLabel returns true for a
TargetOpcode::ANNOTATION_LABEL, which ensures that an annotation label won't
be incorrectly considered safe to move.

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

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

6 years agoMark intrinsics operating on the whole warp as IntrInaccessibleMemOnly
Artem Belevich [Tue, 14 Nov 2017 19:14:00 +0000 (19:14 +0000)]
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

6 years ago[mips] Simplify test for 5.0.1 (NFC)
Simon Dardis [Tue, 14 Nov 2017 19:11:45 +0000 (19:11 +0000)]
[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

6 years ago[llvm-objcopy] Add -strip-non-alloc option to remove all non-allocated sections
Jake Ehrlich [Tue, 14 Nov 2017 18:50:24 +0000 (18:50 +0000)]
[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

6 years agoCodeGen: Fix TargetLowering::LowerCallTo for sret value type
Yaxun Liu [Tue, 14 Nov 2017 18:46:52 +0000 (18:46 +0000)]
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

6 years ago[llvm-objcopy] Support the rest of the ELF formats
Jake Ehrlich [Tue, 14 Nov 2017 18:41:47 +0000 (18:41 +0000)]
[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

6 years ago[PredicateInfo] Stable sort ValueDFS to remove non-deterministic ordering
Mandeep Singh Grang [Tue, 14 Nov 2017 18:22:50 +0000 (18:22 +0000)]
[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

6 years ago[XRay] Stable sort XRayRecord to remove non-deterministic ordering
Mandeep Singh Grang [Tue, 14 Nov 2017 18:11:08 +0000 (18:11 +0000)]
[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

6 years agoAdd missing const qualifier to AttributeSet::operator==
Serge Guelton [Tue, 14 Nov 2017 18:08:05 +0000 (18:08 +0000)]
Add missing const qualifier to AttributeSet::operator==

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

6 years agoAdjust test after r318159
Adam Nemet [Tue, 14 Nov 2017 17:12:36 +0000 (17:12 +0000)]
Adjust test after r318159

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

6 years ago[llvm-profdata] Report if profile data file is IR- or FE-level
Adam Nemet [Tue, 14 Nov 2017 16:59:18 +0000 (16:59 +0000)]
[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

6 years ago[X86] Fix typo in comment. NFC
Craig Topper [Tue, 14 Nov 2017 16:14:00 +0000 (16:14 +0000)]
[X86] Fix typo in comment. NFC

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

6 years ago[Docs] Add tablegen backend for target opcode documentation
Oliver Stannard [Tue, 14 Nov 2017 15:35:15 +0000 (15:35 +0000)]
[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

6 years agoUse input redirection in WebAssembly/comdat.ll test.
Ilya Biryukov [Tue, 14 Nov 2017 14:26:42 +0000 (14:26 +0000)]
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

6 years ago[X86][AVX] Add scheduling test for vmovntdq 256-bit store
Simon Pilgrim [Tue, 14 Nov 2017 14:03:29 +0000 (14:03 +0000)]
[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

6 years ago[LV] Introduce VPBlendRecipe, VPWidenMemoryInstructionRecipe
Gil Rapaport [Tue, 14 Nov 2017 12:09:30 +0000 (12:09 +0000)]
[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

6 years agoARM: correctly update CFG when splitting BB to fix branch.
Tim Northover [Tue, 14 Nov 2017 11:43:54 +0000 (11:43 +0000)]
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

6 years ago[ARM GlobalISel] Remove C++ code for G_CONSTANT
Diana Picus [Tue, 14 Nov 2017 11:20:32 +0000 (11:20 +0000)]
[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

6 years ago[ARM] Fix incorrect conversion of a tail call to an ordinary call
Momchil Velikov [Tue, 14 Nov 2017 10:36:52 +0000 (10:36 +0000)]
[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

6 years agoAMDGPU: Fix test
Matt Arsenault [Tue, 14 Nov 2017 06:40:00 +0000 (06:40 +0000)]
AMDGPU: Fix test

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

6 years ago[opt-viewer] Truncate long remark text in source view
Adam Nemet [Tue, 14 Nov 2017 04:48:18 +0000 (04:48 +0000)]
[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

6 years ago[opt-viewer] With hotness only show max 1000 entries on the index page
Adam Nemet [Tue, 14 Nov 2017 04:37:32 +0000 (04:37 +0000)]
[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

6 years ago[AVR] Remove the select-mbb-placement-bug.ll test
Dylan McKay [Tue, 14 Nov 2017 04:32:49 +0000 (04:32 +0000)]
[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

6 years agoAMDGPU: Fix producing saveexec when the copy is spilled
Matt Arsenault [Tue, 14 Nov 2017 02:16:54 +0000 (02:16 +0000)]
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

6 years ago[PM] Port BoundsChecking to the new PM.
Chandler Carruth [Tue, 14 Nov 2017 01:30:04 +0000 (01:30 +0000)]
[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

6 years agoUse TempFile in llvm-ar. NFC.
Rafael Espindola [Tue, 14 Nov 2017 01:21:15 +0000 (01:21 +0000)]
Use TempFile in llvm-ar. NFC.

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

6 years ago[PM] Refactor BoundsChecking further to prepare it to be exposed both as
Chandler Carruth [Tue, 14 Nov 2017 01:13:59 +0000 (01:13 +0000)]
[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

6 years ago[WebAssembly] Explicily disable comdat support for wasm output
Sam Clegg [Tue, 14 Nov 2017 00:49:16 +0000 (00:49 +0000)]
[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

6 years agoAdd a move assignment operator to TempFile. NFC.
Rafael Espindola [Tue, 14 Nov 2017 00:31:28 +0000 (00:31 +0000)]
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

6 years agoUpdate some code.google.com links
Hans Wennborg [Mon, 13 Nov 2017 23:47:58 +0000 (23:47 +0000)]
Update some code.google.com links

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

6 years agoRevert "Update test_debuginfo.pl script to point to new tree location."
Zachary Turner [Mon, 13 Nov 2017 23:33:29 +0000 (23:33 +0000)]
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

6 years agoSimplify and rename variable.
Rafael Espindola [Mon, 13 Nov 2017 23:32:19 +0000 (23:32 +0000)]
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

6 years agoAMDGPU: Fix not converting d16 load/stores to offset
Matt Arsenault [Mon, 13 Nov 2017 23:24:26 +0000 (23:24 +0000)]
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

6 years agoSimplify. NFC.
Rafael Espindola [Mon, 13 Nov 2017 23:06:54 +0000 (23:06 +0000)]
Simplify. NFC.

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

6 years ago[tablegen] Handle atomic predicates for ordering inside tablegen. NFC.
Daniel Sanders [Mon, 13 Nov 2017 23:03:47 +0000 (23:03 +0000)]
[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

6 years agoAMDGPU: Implement computeKnownBitsForTargetNode for mbcnt
Matt Arsenault [Mon, 13 Nov 2017 22:55:05 +0000 (22:55 +0000)]
AMDGPU: Implement computeKnownBitsForTargetNode for mbcnt

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

6 years ago[tablegen] Handle atomic predicates for memory type inside tablegen. NFC.
Daniel Sanders [Mon, 13 Nov 2017 22:26:13 +0000 (22:26 +0000)]
[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

6 years ago[llvm-objcopy] Add --strip-debug
Jake Ehrlich [Mon, 13 Nov 2017 22:13:08 +0000 (22:13 +0000)]
[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

6 years ago[llvm-objcopy] Add --strip-all option to llvm-objcopy
Jake Ehrlich [Mon, 13 Nov 2017 22:02:07 +0000 (22:02 +0000)]
[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

6 years agoFix -Werror when compiling rL318083 (ter)
Serge Guelton [Mon, 13 Nov 2017 21:55:01 +0000 (21:55 +0000)]
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

6 years agoFix -Werror when compiling rL318083 (bis)
Serge Guelton [Mon, 13 Nov 2017 21:40:57 +0000 (21:40 +0000)]
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

6 years agoFix -Werror when compiling rL318083
Serge Guelton [Mon, 13 Nov 2017 21:25:35 +0000 (21:25 +0000)]
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

6 years agoFix an assertion in SelectionDAG::transferDbgValues()
Adrian Prantl [Mon, 13 Nov 2017 21:24:54 +0000 (21:24 +0000)]
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

6 years agoReorder Value.def to optimize code size
Serge Guelton [Mon, 13 Nov 2017 20:57:40 +0000 (20:57 +0000)]
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

6 years ago[arm] Fix Unnecessary reloads from GOT.
Evgeniy Stepanov [Mon, 13 Nov 2017 20:45:38 +0000 (20:45 +0000)]
[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

6 years ago[Reassociation] regenerate test checks; NFC
Sanjay Patel [Mon, 13 Nov 2017 19:46:28 +0000 (19:46 +0000)]
[Reassociation] regenerate test checks; NFC

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

6 years agoFix clang -Wsometimes-uninitialized warning in SCEV code
Reid Kleckner [Mon, 13 Nov 2017 18:43:11 +0000 (18:43 +0000)]
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

6 years agoNFC, Allow SystemZ SLP tests only when SystemZ is supported.
Dinar Temirbulatov [Mon, 13 Nov 2017 18:35:43 +0000 (18:35 +0000)]
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

6 years agoCreate a TempFile class.
Rafael Espindola [Mon, 13 Nov 2017 18:33:44 +0000 (18:33 +0000)]
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

6 years ago[globalisel][tablegen] Add support for extload.
Daniel Sanders [Mon, 13 Nov 2017 18:30:23 +0000 (18:30 +0000)]
[globalisel][tablegen] Add support for extload.

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

6 years agofix printing of alias instructions by removing redundant spacing
Petar Jovanovic [Mon, 13 Nov 2017 18:00:24 +0000 (18:00 +0000)]
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

6 years ago[ValueTracking] use 'auto' with 'dyn_cast'; NFC
Sanjay Patel [Mon, 13 Nov 2017 17:56:23 +0000 (17:56 +0000)]
[ValueTracking] use 'auto' with 'dyn_cast'; NFC

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

6 years ago[X86] Allow X86ISD::Wrapper to be folded into the base of gather/scatter address
Craig Topper [Mon, 13 Nov 2017 17:53:59 +0000 (17:53 +0000)]
[X86] Allow X86ISD::Wrapper to be folded into the base of gather/scatter address

If the base of our gather corresponds to something contained in X86ISD::Wrapper we should be able to fold it into the address.

This patch refactors some of the address matching to more fully use the X86ISelAddressMode struct and the getAddressOperands helper. A new helper function matchVectorAddress is added to call matchWrapper or fall back to matchAddressBase.

We should also be able to support constant offsets from a wrapper, but I'll look into that in a future patch. We may even be able to completely reuse matchAddress here, but I wanted to start simple and work up to it.

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

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

6 years ago[ValueTracking] simplify code in CannotBeNegativeZero() with match(); NFCI
Sanjay Patel [Mon, 13 Nov 2017 17:40:47 +0000 (17:40 +0000)]
[ValueTracking] simplify code in CannotBeNegativeZero() with match(); NFCI

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

6 years ago[Reassociate] add tests with 'reassoc' FMF; NFC
Sanjay Patel [Mon, 13 Nov 2017 17:29:11 +0000 (17:29 +0000)]
[Reassociate] add tests with 'reassoc' FMF; NFC

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

6 years agoAMDGPU: Drop duplicate setOperationAction
Jan Vesely [Mon, 13 Nov 2017 16:46:07 +0000 (16:46 +0000)]
AMDGPU: Drop duplicate setOperationAction

These are set with other scalar int ops few lines up

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

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

6 years ago[SCEV] Handling for ICmp occuring in the evolution chain.
Jatin Bhateja [Mon, 13 Nov 2017 16:43:24 +0000 (16:43 +0000)]
[SCEV] Handling for ICmp occuring in the evolution chain.

Summary:
 If a compare instruction is same or inverse of the compare in the
 branch of the loop latch, then return a constant evolution node.
 This shall facilitate computations of loop exit counts in cases
 where compare appears in the evolution chain of induction variables.

 Will fix PR 34538

Reviewers: sanjoy, hfinkel, junryoungju

Reviewed By: sanjoy, junryoungju

Subscribers: javed.absar, llvm-commits

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

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

6 years agoRevert "[CodeGenPrepare] Check that erased sunken address are not reused"
Simon Dardis [Mon, 13 Nov 2017 16:41:17 +0000 (16:41 +0000)]
Revert "[CodeGenPrepare] Check that erased sunken address are not reused"

This reverts commit r318032. The test broke some sanitizer bots.

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

6 years ago[ARM GlobalISel] Update legalizer test
Diana Picus [Mon, 13 Nov 2017 16:02:42 +0000 (16:02 +0000)]
[ARM GlobalISel] Update legalizer test

Make one of the legalizer tests a bit more robust by making sure all
values we're interested in are used (either in a store or a return) and
by using loads instead of constants for obtaining values on fewer than
32 bits. This should make the test less fragile to changes in the
legalize combiner, since those loads are legal (as opposed to the
constants, which were being widened and thus produced opportunities for
the legalize combiner).

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

6 years ago[PowerPC][msan] Update msan to handle changed memory layouts in newer kernels
Bill Seurer [Mon, 13 Nov 2017 15:43:19 +0000 (15:43 +0000)]
[PowerPC][msan] Update msan to handle changed memory layouts in newer kernels

In more recent Linux kernels (including those with 47 bit VMAs) the layout of
virtual memory for powerpc64 changed causing the memory sanitizer to not
work properly. This patch adjusts a bit mask in the memory sanitizer to work
on the newer kernels while continuing to work on the older ones as well.

This is the non-runtime part of the patch and finishes it. ref: r317802

Tested on several 4.x and 3.x kernel releases.

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

6 years agoInserting a base test for X86 performance nops
Omer Paparo Bivas [Mon, 13 Nov 2017 15:02:39 +0000 (15:02 +0000)]
Inserting a base test for X86 performance nops

Change-Id: I69da08b617d7fae8024c5aee04720eb465f39b81

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

6 years ago[X86] test/testn intrinsics lowering to IR. llvm part.
Uriel Korach [Mon, 13 Nov 2017 12:51:18 +0000 (12:51 +0000)]
[X86] test/testn intrinsics lowering to IR. llvm part.

Remove builtins from llvm and add AutoUpgrade support.
Also add fast-isel tests for the TEST and TESTN instructions.

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

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

6 years agoMove the setting of LLVM_BUILD_MODE to a macro so that we can re-use it in compiler-rt
Greg Bedwell [Mon, 13 Nov 2017 12:40:05 +0000 (12:40 +0000)]
Move the setting of LLVM_BUILD_MODE to a macro so that we can re-use it in compiler-rt

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

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

6 years ago[ARM] Place jump table as the first operand in additions
Momchil Velikov [Mon, 13 Nov 2017 11:56:48 +0000 (11:56 +0000)]
[ARM] Place jump table as the first operand in additions

When generating table jump code for switch statements, place the jump
table label as the first operand in the various addition instructions
in order to enable addressing mode selectors to better match index
computation and possibly fold them into the addressing mode of the
table entry load instruction.

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

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

6 years ago[CodeGenPrepare] Check that erased sunken address are not reused
Simon Dardis [Mon, 13 Nov 2017 11:47:21 +0000 (11:47 +0000)]
[CodeGenPrepare] Check that erased sunken address are not reused

CodeGenPrepare sinks address computations from one basic block to another
and attempts to reuse address computations that have already been sunk. If
the same address computation appears twice with the first instance as an
operand of a load whose result is an operand to a simplifable select,
CodeGenPrepare simplifies the select and recursively erases the now dead
instructions. CodeGenPrepare then attempts to use the erased address
computation for the second load.

Fix this by erasing the cached address value if it has zero uses before
looking for the address value in the sunken address map.

This partially resolves PR35209.

Thanks to Alexander Richardson for reporting the issue!

Reviewers: john.brawn

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

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

6 years ago[CodeExtractor] Add missing AllowVarArgs initialization.
Florian Hahn [Mon, 13 Nov 2017 11:08:47 +0000 (11:08 +0000)]
[CodeExtractor] Add missing AllowVarArgs initialization.

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

6 years ago[PartialInliner] Inline vararg functions that forward varargs.
Florian Hahn [Mon, 13 Nov 2017 10:35:52 +0000 (10:35 +0000)]
[PartialInliner] Inline vararg functions that forward varargs.

Summary:
This patch extends the partial inliner to support inlining parts of
vararg functions, if the vararg handling is done in the outlined part.

It adds a `ForwardVarArgsTo` argument to InlineFunction. If it is
non-null, all varargs passed to the inlined function will be added to
all calls to `ForwardVarArgsTo`.

The partial inliner takes care to only pass `ForwardVarArgsTo` if the
varargs handing is done in the outlined function. It checks that vastart
is not part of the function to be inlined.

`test/Transforms/CodeExtractor/PartialInlineNoInline.ll` (already part
of the repo) checks we do not do partial inlining if vastart is used in
a basic block that will be inlined.

Reviewers: davide, davidxl, grosser

Reviewed By: davide, davidxl, grosser

Subscribers: gyiu, grosser, eraman, llvm-commits

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

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

6 years agoTest commit
Sander de Smalen [Mon, 13 Nov 2017 09:57:20 +0000 (09:57 +0000)]
Test commit

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

6 years ago[x86][AVX512] Lowering shuffle i/f intrinsics to LLVM IR
Jina Nahias [Mon, 13 Nov 2017 09:16:39 +0000 (09:16 +0000)]
[x86][AVX512] Lowering shuffle i/f intrinsics to LLVM IR

This patch, together with a matching clang patch (https://reviews.llvm.org/D38672), implements the lowering of X86 shuffle i/f intrinsics to IR.

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

Change-Id: I1e7d359a74743e995ec356237a85214ce55d3661

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

6 years ago[X86][SKX] Adding scheduling info of non-intrinsic + commutable SKX opcodes.
Gadi Haber [Mon, 13 Nov 2017 08:42:07 +0000 (08:42 +0000)]
[X86][SKX] Adding scheduling info of non-intrinsic + commutable SKX opcodes.

Updated the scheduling information of the SKX subtarget  in the file X86SchedSkylakeServer.td under lib/Target/X86 to:
1. add regular opcodes in addition to the suffixed "_Int" opcodes
2. add the (V)MAXCPD/MAXCPS/MAXCSD/MAXCSS/MINCPD/MINCPS/MINCSD/MINCSS
    instructions that are equivalent to their counterparts without the 'C' as they are part of a hack to
    make floating point min/max commutable under fast math.

Reviewers: zvi, RKSimon, craig.topper
Differential Revision: https://reviews.llvm.org/D39833

Change-Id: Ie13702a5ce1b1a08af91ca637a52b6962881e7d6

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

6 years ago[X86] Limit NOPs to 7 bytes when 'slm' is spelled 'silvermont'.
Craig Topper [Mon, 13 Nov 2017 08:17:30 +0000 (08:17 +0000)]
[X86] Limit NOPs to 7 bytes when 'slm' is spelled 'silvermont'.

We support 2 spelling for silvermont and we should accept both here.

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

6 years ago[X86] Use sse_load_f32/f64 to improve load folding of scalar vfscalefss/sd, vrcp14ss...
Craig Topper [Mon, 13 Nov 2017 08:07:33 +0000 (08:07 +0000)]
[X86] Use sse_load_f32/f64 to improve load folding of scalar vfscalefss/sd, vrcp14ss/sd, rsqrt14ss/sd instructions.

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

6 years ago[X86] Regenerate test. NFC
Craig Topper [Mon, 13 Nov 2017 08:07:31 +0000 (08:07 +0000)]
[X86] Regenerate test. NFC

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

6 years agoMI: Print ranges on MMO
Matt Arsenault [Mon, 13 Nov 2017 07:09:20 +0000 (07:09 +0000)]
MI: Print ranges on MMO

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

6 years ago[X86] Use sse_load_f32/f64 to improve load folding for scalar VFPCLASS intrinsics.
Craig Topper [Mon, 13 Nov 2017 06:46:48 +0000 (06:46 +0000)]
[X86] Use sse_load_f32/f64 to improve load folding for scalar VFPCLASS intrinsics.

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

6 years ago[X86] Add tests for missed opportunities to fold a 128-bit vector load into vfpclasss...
Craig Topper [Mon, 13 Nov 2017 06:46:46 +0000 (06:46 +0000)]
[X86] Add tests for missed opportunities to fold a 128-bit vector load into vfpclassss and vpfpclasssd.

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

6 years agoAMDGPU: Preserve nuw in shl add ptr combine
Matt Arsenault [Mon, 13 Nov 2017 05:33:35 +0000 (05:33 +0000)]
AMDGPU: Preserve nuw in shl add ptr combine

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

6 years ago[X86] Fix SQRTSS/SQRTSD/RCPSS/RCPSD intrinsics to use sse_load_f32/sse_load_f64 to...
Craig Topper [Mon, 13 Nov 2017 05:25:24 +0000 (05:25 +0000)]
[X86] Fix SQRTSS/SQRTSD/RCPSS/RCPSD intrinsics to use sse_load_f32/sse_load_f64 to increase load folding opportunities.

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

6 years ago[X86] Add tests for full vector loads to fold-load-unops.ll.
Craig Topper [Mon, 13 Nov 2017 05:25:23 +0000 (05:25 +0000)]
[X86] Add tests for full vector loads to fold-load-unops.ll.

We should be able to fold a full vector load into a scalar intrinsic. Since it's legal to narrow a load.

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

6 years ago[X86] Regenerate fold-load-unops.ll and add and avx512f command line.
Craig Topper [Mon, 13 Nov 2017 05:25:21 +0000 (05:25 +0000)]
[X86] Regenerate fold-load-unops.ll and add and avx512f command line.

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

6 years agoAMDGPU: Fix multi-use shl/add combine
Matt Arsenault [Mon, 13 Nov 2017 05:11:54 +0000 (05:11 +0000)]
AMDGPU: Fix multi-use shl/add combine

This was using a custom function that didn't handle the
addressing modes properly for private. Use
isLegalAddressingMode to avoid duplicating this.

Additionally, skip the combine if there is only one use
since the standard combine will handle it.

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

6 years ago[X86] Attempt to fix signed and unsigned comparison warning.
Craig Topper [Mon, 13 Nov 2017 02:19:13 +0000 (02:19 +0000)]
[X86] Attempt to fix signed and unsigned comparison warning.

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

6 years ago[X86] Use sse_load_f32/f64 in patterns for the memory forms of VRNDSCALESS/SD.
Craig Topper [Mon, 13 Nov 2017 02:03:01 +0000 (02:03 +0000)]
[X86] Use sse_load_f32/f64 in patterns for the memory forms of VRNDSCALESS/SD.

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

6 years ago[X86] Use EVEX encoded VRNDSCALE instructions to implement the legacy round intrinsics.
Craig Topper [Mon, 13 Nov 2017 02:03:00 +0000 (02:03 +0000)]
[X86] Use EVEX encoded VRNDSCALE instructions to implement the legacy round intrinsics.

The VRNDSCALE instructions implement a superset of the (V)ROUND instructions. They are equivalent if the upper 4-bits of the immediate are 0.

This patch lowers the legacy intrinsics to the VRNDSCALE ISD node and masks the upper bits of the immediate to 0. This allows us to take advantage of the larger register encoding space.

We should maybe consider converting VRNDSCALE back to VROUND in the EVEX to VEX pass if the extended registers are not being used.

I notice some load folding opportunities being missed for the VRNDSCALESS/SD instructions that I'll try to fix in future patches.

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

6 years ago[X86] Split VRNDSCALE/VREDUCE/VGETMANT/VRANGE ISD nodes into versions with and withou...
Craig Topper [Mon, 13 Nov 2017 02:02:58 +0000 (02:02 +0000)]
[X86] Split VRNDSCALE/VREDUCE/VGETMANT/VRANGE ISD nodes into versions with and without the rounding operand. NFCI

I want to reuse the VRNDSCALE node for the legacy SSE rounding intrinsics so that those intrinsics can use EVEX instructions. All of these nodes share tablegen multiclasses so I split them all so that they all remain similar in their implementations.

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

6 years agoFix some misc. -enable-var-scope violations
Matt Arsenault [Mon, 13 Nov 2017 01:47:52 +0000 (01:47 +0000)]
Fix some misc. -enable-var-scope violations

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

6 years agoAMDGPU: Select d16 loads into low component of register
Matt Arsenault [Mon, 13 Nov 2017 00:22:09 +0000 (00:22 +0000)]
AMDGPU: Select d16 loads into low component of register

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

6 years agoAMDGPU: Fix -enable-var-scope violations
Matt Arsenault [Sun, 12 Nov 2017 23:53:44 +0000 (23:53 +0000)]
AMDGPU: Fix -enable-var-scope violations

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

6 years agoAMDGPU: Fix missing gfx9 atomic inc/dec tests
Matt Arsenault [Sun, 12 Nov 2017 23:40:12 +0000 (23:40 +0000)]
AMDGPU: Fix missing gfx9 atomic inc/dec tests

The global instructions weren't tested. Plus there
were also some -enable-var-scope violations and
broken check prefixes.

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

6 years ago[X86] Add an X86ISD::RANGES opcode to use for the scalar intrinsics.
Craig Topper [Sun, 12 Nov 2017 18:51:09 +0000 (18:51 +0000)]
[X86] Add an X86ISD::RANGES opcode to use for the scalar intrinsics.

This fixes a bug where we selected packed instructions for scalar intrinsics.

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

6 years ago[X86] Add test cases and command lines demonstrating how we accidentally select vrang...
Craig Topper [Sun, 12 Nov 2017 18:51:08 +0000 (18:51 +0000)]
[X86] Add test cases and command lines demonstrating how we accidentally select vrangeps/vrangepd from vrangess/vrangesd instrinsics when the rounding mode is CUR_DIRECTION

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

6 years ago[X86] Remove some no longer needed intrinsic lowering code.
Craig Topper [Sun, 12 Nov 2017 18:51:06 +0000 (18:51 +0000)]
[X86] Remove some no longer needed intrinsic lowering code.

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

6 years ago[llvm] Remove redundant return [NFC]
Mandeep Singh Grang [Sun, 12 Nov 2017 03:47:50 +0000 (03:47 +0000)]
[llvm] Remove redundant return [NFC]

Reviewers: davidxl, olista01, Eugene.Zelenko

Reviewed By: Eugene.Zelenko

Subscribers: sdardis, javed.absar, llvm-commits

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

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

6 years ago[InstCombine] Teach visitICmpInst to not break integer absolute value idioms
Craig Topper [Sun, 12 Nov 2017 02:28:21 +0000 (02:28 +0000)]
[InstCombine] Teach visitICmpInst to not break integer absolute value idioms

Summary:
This patch adds an early out to visitICmpInst if we are looking at a compare as part of an integer absolute value idiom. Similar is already done for min/max.

In the particular case I observed in a benchmark we had an absolute value of a load from an indexed global. We simplified the compare using foldCmpLoadFromIndexedGlobal into a magic bit vector, a shift, and an and. But the load result was still used for the select and the negate part of the absolute valute idiom. So we overcomplicated the code and lost the ability to recognize it as an absolute value.

I've chosen a simpler case for the test here.

Reviewers: spatel, davide, majnemer

Reviewed By: spatel

Subscribers: llvm-commits

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

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

6 years ago[X86] Use vrndscaleps/pd for 128/256 ffloor/ftrunc/fceil/fnearbyint/frint when avx512...
Craig Topper [Sat, 11 Nov 2017 21:44:51 +0000 (21:44 +0000)]
[X86] Use vrndscaleps/pd for 128/256 ffloor/ftrunc/fceil/fnearbyint/frint when avx512vl is enabled.

This matches what we do for scalar and 512-bit types.

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

6 years ago[X86] Remove avx512-round.ll. The 512-bit rounding tests are now in vec_floor.ll...
Craig Topper [Sat, 11 Nov 2017 21:44:50 +0000 (21:44 +0000)]
[X86] Remove avx512-round.ll. The 512-bit rounding tests are now in vec_floor.ll with 128/256 sizes.

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