Commit Graph

147187 Commits

Author SHA1 Message Date
Simon Pilgrim
a4ee850374 [X86][AVX2] Add support for combining v16i16 shuffles to VPBLENDW
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298929 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-28 16:40:38 +00:00
Craig Topper
ee18eb90ff [AVX-512] Fix accidental uses of AH/BH/CH/DH after copies to/from mask registers
We've had several bugs(PR32256, PR32241) recently that resulted from usages of AH/BH/CH/DH either before or after a copy to/from a mask register.

This ultimately occurs because we create COPY_TO_REGCLASS with VK1 and GR8. Then in CopyToFromAsymmetricReg in X86InstrInfo we find a 32-bit super register for the GR8 to emit the KMOV with. But as these tests are demonstrating, its possible for the GR8 register to be a high register and we end up doing an accidental extra or insert from bits 15:8.

I think the best way forward is to stop making copies directly between mask registers and GR8/GR16. Instead I think we should restrict to only copies between mask registers and GR32/GR64 and use EXTRACT_SUBREG/INSERT_SUBREG to handle the conversion from GR32 to GR16/8 or vice versa.

Unfortunately, this complicates fastisel a bit more now to create the subreg extracts where we used to create GR8 copies. We can probably make a helper function to bring down the repitition.

This does result in KMOVD being used for copies when BWI is available because we don't know the original mask register size. This caused a lot of deltas on tests because we have to split the checks for KMOVD vs KMOVW based on BWI.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298928 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-28 16:35:29 +00:00
Sanjay Patel
3409abefac [x86] add separate check prefix for SSE; NFC
We want to check each test on each target, so we need another prefix
when SSE and AVX diverge (as they will if we handle 32-byte and higher). 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298926 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-28 15:55:50 +00:00
Simon Pilgrim
1a36c64204 [X86][SSE] Refactored shuffle BLEND combining to make future 16i16 support easier. NFCI.
Call the matchVectorShuffleAsBlend test as early as possible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298925 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-28 15:50:23 +00:00
Nirav Dave
227a06d5bb [SDAG] Avoid deleted SDNodes PromoteIntBinOp
Reorder work in PromoteIntBinOp to prevent stale (deleted) nodes from
being used.

Fixes PR32340 and PR32345.

Reviewers: hfinkel, dbabokin

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298923 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-28 15:41:12 +00:00
Nirav Dave
5dc2b58301 [SDAG] Fix Stale SDNode usage in visitAND
Reorder CombineTo Calls to prevent potential use of deleted node.
Fixes PR32372.

Reviewers: jnspaulsson, RKSimon, uweigand, jonpa

Reviewed By: jonpa

Subscribers: jonpa, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298920 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-28 14:11:20 +00:00
Sanjay Patel
e43ad9f700 [x86] add AVX2 run to show 256-bit opportunity; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298918 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-28 13:46:50 +00:00
Simon Pilgrim
c47b59c064 Fix signed/unsigned comparison warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298917 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-28 13:40:09 +00:00
Nirav Dave
e6987121ba [SDAG] Minor cleanup of variable usage. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298916 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-28 13:39:50 +00:00
Simon Pilgrim
3d39cb0a48 [X86][SSE] Begin merging vector shuffle to BLEND for lowering and combining.
Split off matchVectorShuffleAsBlend from lowerVectorShuffleAsBlend for reuse in combining.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298914 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-28 13:05:48 +00:00
Simon Pilgrim
3781220f49 Wdocumentation fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298911 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-28 12:29:09 +00:00
Simon Pilgrim
f67785e440 [X86][SSE] Set second operand to undef instead of first operand in unary shuffle combines.
Copy isn't necessary after the matchVectorShuffleWithUNPCK refactor and undef value will make some future undef/zero handling easier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298910 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-28 12:16:42 +00:00
Simon Pilgrim
eb81f2b1a2 Strip trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298909 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-28 11:15:17 +00:00
Sanne Wouda
c05e81481a [AArch64] [Assembler] option to disable negative immediate conversions
Summary:
Similar to the ARM target in https://reviews.llvm.org/rL298380, this
patch adds identical infrastructure for disabling negative immediate
conversions, and converts the existing aliases to the new infrastucture.

Reviewers: rengolin, javed.absar, olista01, SjoerdMeijer, samparker

Reviewed By: samparker

Subscribers: samparker, aemerson, llvm-commits

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298908 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-28 10:02:56 +00:00
Igor Breger
7a3b1c28d8 [GlobalISel][X86] support G_FRAME_INDEX instruction selection.
Summary:
    G_LOAD/G_STORE, add alternative RegisterBank mapping.
    For G_LOAD, Fast and Greedy mode choose the same RegisterBank mapping (GprRegBank ) for the G_GLOAD + G_FADD , can't get rid of cross register bank copy GprRegBank->VecRegBank.

    Reviewers: zvi, rovka, qcolombet, ab

    Reviewed By: zvi

    Subscribers: llvm-commits, dberris, kristof.beyls, eladcohen, guyblank

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298907 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-28 09:35:06 +00:00
Anna Thomas
90db4d6a69 [InstCombine] For select rule, use positive check of constant int for select operand. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298906 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-28 09:32:24 +00:00
Anna Thomas
495d20631a rename instcombine test file. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298904 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-28 08:34:07 +00:00
Valery Pykhtin
072955ea76 [AMDGPU] Update SI scheduler colorHighLatenciesGroups
Depends on rL298896: MachineScheduler/ScheduleDAG: Add support for GetSubGraph

Patch by Axel Davy (axel.davy@normalesup.org)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298902 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-28 07:19:48 +00:00
Weiming Zhao
3a50eea6d9 Dont emit Mapping symbols for sections that contain only data.
Summary:
Dont emit mapping symbols for sections that contain only data.

Patched by Shankar Easwaran <shankare@codeaurora.org>

Reviewers: rengolin, peter.smith, weimingz, kparzysz, t.p.northover

Reviewed By: t.p.northover

Subscribers: t.p.northover, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298901 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-28 05:40:36 +00:00
Craig Topper
cc9aca6616 [APInt] Reformat tc functions to put opening curly braces on the end of the previous line. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298900 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-28 05:32:55 +00:00
Craig Topper
b68e2b67cc [APInt] Remove an anonymous namespace around static functions. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298899 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-28 05:32:53 +00:00
Craig Topper
a77792d82f [APInt] Combine variable declaration and initialization where possible in the tc functions. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298898 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-28 05:32:52 +00:00
Craig Topper
0bdb15850f [APInt] Use 'unsigned' instead of 'unsigned int' in the interface to the APInt tc functions. This is more consistent with the rest of the codebase. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298897 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-28 05:32:48 +00:00
Valery Pykhtin
217a56948a MachineScheduler/ScheduleDAG: Add support for GetSubGraph
Patch by Axel Davy (axel.davy@normalesup.org)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298896 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-28 05:12:31 +00:00
Junmo Park
c0fa0b7573 CodeGen : Check LLVM_ENABLE_DUMP definition for dumpMachineInstrRangeWithSlotIndex.
Summary:
Add missing check routine for dumpMachineInstrRangeWithSlotIndex including LLVM_DUMP_METHOD.

Reviewers: bkramer

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298895 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-28 04:14:25 +00:00
Craig Topper
38ca8aac82 [APInt] Move the single word cases of the bitwise operators inline.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298894 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-28 04:00:47 +00:00
Alex Shlyapnikov
af689e8d8f Revert "[asan] Delay creation of asan ctor."
Speculative revert. Some libfuzzer tests are affected.

This reverts commit r298731.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298890 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-27 23:11:50 +00:00
Alex Shlyapnikov
3c1e4143ba Revert "[asan] Put ctor/dtor in comdat."
Speculative revert, some libfuzzer tests are affected.

This reverts commit r298756.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298889 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-27 23:11:47 +00:00
Eric Christopher
617b05090f Remove an oddly unnecessary temporary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298888 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-27 22:40:51 +00:00
Renato Golin
92ef0d2078 [ARM] Mark falky test unsupported until we find the cause
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298887 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-27 22:38:43 +00:00
Juergen Ributzka
26cbef5f44 [libfuzzer] Remove XFAIL for OutOfMemory test.
This test is now passing on Darwin.

See rdar://problem/31282257.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298886 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-27 22:33:05 +00:00
Javed Absar
47652291c2 Improve machine schedulers for in-order processors
This patch enables schedulers to specify instructions that 
cannot be issued with any other instructions.
It also fixes BeginGroup/EndGroup.

Reviewed by: Andrew Trick
Differential Revision: https://reviews.llvm.org/D30744



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298885 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-27 20:46:37 +00:00
Kevin Enderby
3903b47a90 Add the error handling for Mach-O dyld compact lazy bind, weak bind and
rebase entry errors and test cases for each of the error checks.

Also verified with Nick Kledzik that a BIND_OPCODE_SET_ADDEND_SLEB
opcode is legal in a lazy bind table, so code that had that as an error
check was removed.

With MachORebaseEntry and MachOBindEntry classes now returning
an llvm::Error in all cases for malformed input the variables Malformed
and logic to set use them is no longer needed and has been removed
from those classes.

Also in a few places, removed the redundant Done assignment to true
when also calling moveToEnd() as it does that assignment.

This only leaves the dyld compact export entries left to have
error handling yet to be added for the dyld compact info.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298883 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-27 20:09:23 +00:00
Matthew Simpson
fcdf36fabb [LV] Transform truncations of non-primary induction variables
The vectorizer tries to replace truncations of induction variables with new
induction variables having the smaller type. After r295063, this optimization
was applied to all integer induction variables, including non-primary ones.
When optimizing the truncation of a non-primary induction variable, we still
need to transform the new induction so that it has the correct start value.
This should fix PR32419.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298882 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-27 20:07:38 +00:00
Craig Topper
28ec1cc892 [APInt] Move operator=(uint64_t) inline as its pretty simple and is often used with small constants that the compiler can optimize.
While there recognize that we only need to clearUnusedBits on the single word case.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298881 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-27 20:07:31 +00:00
Krzysztof Parzyszek
daa7fe44b1 [TableGen] Print #nnn as a name of an non-native reg unit with id nnn
When using -debug with -gen-register-info, tablegen will crash when
trying to print a name of a non-native register unit. This patch only
affects the debug information generated while running llvm-tblgen,
and has no impact on the compilable code coming out of it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298875 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-27 19:08:24 +00:00
Valery Pykhtin
bc04e5d6d2 [AMDGPU] SISched: Detect dependency types between blocks
Patch by Axel Davy (axel.davy@normalesup.org)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298872 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-27 18:22:39 +00:00
Bruno Cardoso Lopes
fa92ec8e9e [Support] Avoid concurrency hazard in signal handler registration
Several static functions from the signal API can be invoked
simultaneously; RemoveFileOnSignal for instance can be called indirectly
by multiple parallel loadModule() invocations, which might lead to
the assertion:

Assertion failed: (NumRegisteredSignals < array_lengthof(RegisteredSignalInfo) && "Out of space for signal handlers!"),
  function RegisterHandler, file /llvm/lib/Support/Unix/Signals.inc, line 105.

RemoveFileOnSignal calls RegisterHandlers(), which isn't currently
mutex protected, leading to the behavior above. This potentially affect
a few other users of RegisterHandlers() too.

rdar://problem/30381224

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298871 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-27 18:21:31 +00:00
Craig Topper
0532ee926c [APInt] Move operator&=(uint64_t) inline and use memset to clear the upper words.
This method is pretty new and probably isn't use much in the code base so this should have a negligible size impact. The OR and XOR operators are already inline.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298870 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-27 18:16:17 +00:00
Ahmed Bougacha
c53cf7e424 [GlobalISel][AArch64] Extract a variable out of an NDEBUG block. NFC.
r298863 used PtrReg, but that's never defined in release builds. Fix it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298869 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-27 18:14:20 +00:00
Craig Topper
31355ac435 [APInt] Use memset in setAllBits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298867 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-27 17:50:54 +00:00
Adrian Prantl
91a21c4db6 Remove redundant check for nullptr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298866 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-27 17:36:31 +00:00
Adrian Prantl
573d120591 Remove unneccessary virtual destructor from DwarfExpression.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298865 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-27 17:34:04 +00:00
Ahmed Bougacha
97874bddd6 [GlobalISel][AArch64] Fold FI into LDR/STR ui addressing mode.
A majority of loads and stores at O0 access an alloca.

It's trivial to fold the G_FRAME_INDEX into the instruction; do it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298864 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-27 17:31:56 +00:00
Ahmed Bougacha
db6b71ba79 [GlobalISel][AArch64] Fold G_GEP into LDR/STR ui addressing mode.
We're not to the point of supporting the load/store patterns yet
(because they extensively use PatFrags).

But in the meantime, we can implement some of the simplest addressing
modes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298863 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-27 17:31:52 +00:00
Ahmed Bougacha
3d5ea4cd13 [GlobalISel][AArch64] Select store of zero to WZR/XZR.
These occur very frequently, and are quite trivial to catch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298862 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-27 17:31:48 +00:00
Valery Pykhtin
96f1d455e7 [AMDGPU] SISched: Update colorEndsAccordingToDependencies
Patch by Axel Davy (axel.davy@normalesup.org)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298861 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-27 17:26:40 +00:00
Craig Topper
82ba8a6268 [APInt] Move the >64 bit case for flipAllBits out of line.
This is more consistent with what we do for other operations. This shrinks the opt binary on my build by ~72k.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298858 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-27 17:10:21 +00:00
Valery Pykhtin
2a867a816e [AMDGPU] Fix SI scheduler LiveOut Refcount issue
Patch by Axel Davy (axel.davy@normalesup.org)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298857 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-27 17:06:36 +00:00
Ahmed Bougacha
2597299d8e [GlobalISel][AArch64] Select CBZ.
CBZ/CBNZ represent a substantial portion of all conditional branches.
Look through G_ICMP to select them.

We can't use tablegen yet because the existing patterns match an
AArch64ISD node.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298856 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-27 16:35:31 +00:00