146976 Commits

Author SHA1 Message Date
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
Ahmed Bougacha
fb6a2d6627 [GlobalISel] Add a 'getConstantVRegVal' helper.
Use it to compare immediate operands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298855 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-27 16:35:27 +00:00
Ahmed Bougacha
460b732910 [GlobalISel][AArch64] Use proper constant types in test. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298854 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-27 16:35:23 +00:00
Dmitry Preobrazhensky
cb5431a931 [AMDGPU][MC] Fix for Bug 28207 + LIT tests
Enabled clamp and omod for v_cvt_* opcodes which have src0 of an integer type

Reviewers: vpykhtin, arsenm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298852 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-27 15:57:17 +00:00
Chad Rosier
c7506ed124 [AArch64] Mark mrs of TPIDR_EL0 (thread pointer) as not having side effects.
Among other things, this allows Machine LICM to hoist a costly 'mrs'
instruction from within a loop.

Differential Revision: http://reviews.llvm.org/D31151

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298851 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-27 15:52:38 +00:00
Yaxun Liu
ab3be33d40 [AMDGPU] Get address space mapping by target triple environment
As we introduced target triple environment amdgiz and amdgizcl, the address
space values are no longer enums. We have to decide the value by target triple.

The basic idea is to use struct AMDGPUAS to represent address space values.
For address space values which are not depend on target triple, use static
const members, so that they don't occupy extra memory space and is equivalent
to a compile time constant.

Since the struct is lightweight and cheap, it can be created on the fly at
the point of usage. Or it can be added as member to a pass and created at
the beginning of the run* function.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298846 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-27 14:04:01 +00:00
Anna Thomas
e8b81e06e1 [InstCombine] Avoid incorrect folding of select into phi nodes when incoming element is a vector type
Summary:
We are incorrectly folding selects into phi nodes when the incoming value of a phi
node is a constant vector. This optimization is done in `FoldOpIntoPhi` when the
select condition is a phi node with constant incoming values.
Without the fix, we are miscompiling (i.e. incorrectly folding the
select into the phi node) when the vector contains non-zero
elements.
This patch fixes the miscompile and we will correctly fold based on the
select vector operand (see added test cases).

Reviewers: majnemer, sanjoy, spatel

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298845 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-27 13:52:51 +00:00
Daniel Sanders
df544d6b0b Correct OptionCategoryCompare() in the command line library.
Summary:
It should return <0, 0, or >0 for less-than, equal, and greater-than like
strcmp() (according to the history, it used to be implemented with
strcmp()) but it actually returned 0, or 1 for not-equal and equal.

Reviewers: qcolombet

Reviewed By: qcolombet

Subscribers: qcolombet, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298844 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-27 13:43:24 +00:00
Daniel Sanders
d5d860727b [tablegen] Use categories on options that only matter to one emitter.
Summary:
The categories are emitted in a strange order in this patch due to a bug in the
CommandLine library.

Reviewers: ab

Reviewed By: ab

Subscribers: ab, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298843 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-27 13:15:13 +00:00
Justin Bogner
acec6edc61 ADT: Add range helpers for pointer_ and pointee_iterator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298841 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-27 12:56:12 +00:00
Gadi Haber
cd2a3f9e73 [X86][AVX2] bugzilla bug 21281 Performance regression in vector interleave in AVX2
This is a patch for an on-going bugzilla bug 21281 on the generated X86 code for a matrix transpose8x8 subroutine which requires vector interleaving. The generated code in AVX2 is currently non-optimal and requires 60 instructions as opposed to only 40 instructions generated for AVX1.
 The patch includes a fix for the AVX2 case where vector unpack instructions use less operations than the vector blend operations available in AVX2.
 In this case using vector unpack instructions is more efficient.

Reviewers:
zvi  
delena  
igorb  
craig.topper  
guyblank  
eladcohen  
m_zuckerman  
aymanmus  
RKSimon 



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298840 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-27 12:13:37 +00:00
Karl-Johan Karlsson
f6c7abbfd1 [TableGen] Make CodeGenMapTable understand the namespace field of an instruction
Do not force the backends to use target name as namespace.

Original patch by Mattias Eriksson

Reviewers: stoklund, craig.topper

Reviewed By: stoklund

Subscribers: materi, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298834 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-27 07:13:44 +00:00