OSDN Git Service

android-x86/external-llvm.git
5 years ago[llvm-objdump] Make --disassemble-functions imply -d
George Rimar [Tue, 21 May 2019 11:05:46 +0000 (11:05 +0000)]
[llvm-objdump] Make --disassemble-functions imply -d

Fixes https://bugs.llvm.org/show_bug.cgi?id=41903

Patch by Mike Pozulp!

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

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

5 years ago[MergeICmps] Preserve the dominator tree.
Clement Courbet [Tue, 21 May 2019 11:02:23 +0000 (11:02 +0000)]
[MergeICmps] Preserve the dominator tree.

Summary: In preparation for D60318 .

Reviewers: gchatelet, efriedma

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

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

5 years ago[PPC64] Update LocalEntry from assigned symbols
Fangrui Song [Tue, 21 May 2019 10:41:25 +0000 (10:41 +0000)]
[PPC64] Update LocalEntry from assigned symbols

On PowerPC64 ELFv2 ABI, functions may have 2 entry points: global and local.
The local entry point location of a function is stored in the st_other field of the symbol, as an offset relative to the global entry point.

In order to make symbol assignments (e.g. .equ/.set) work properly with this, PPCTargetELFStreamer already copies the local entry bits from the source symbol to the destination one, on emitAssignment(). The problem is that this copy is performed only at the assignment location, where the source symbol may not yet have processed the .localentry directive, that sets the local entry. This may cause the destination symbol to end up with wrong local entry information. Other symbol info is not affected by this because, in this case, the destination symbol value is actually a symbol reference.

This change keeps track of these assignments, and update all needed st_other fields when finish() is called.

Patch by Leandro Lupori!

Reviewed By: MaskRay

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

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

5 years ago[AArch64] Skip mask checks for masks with an odd number of elements.
Florian Hahn [Tue, 21 May 2019 10:05:26 +0000 (10:05 +0000)]
[AArch64] Skip mask checks for masks with an odd number of elements.

Some checks in isShuffleMaskLegal expect an even number of elements,
e.g. isTRN_v_undef_Mask or isUZP_v_undef_Mask, otherwise they access
invalid elements and crash. This patch adds checks to the impacted
functions.

Fixes PR41951

Reviewers: t.p.northover, dmgreen, samparker

Reviewed By: dmgreen

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

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

5 years ago[llvm-objcopy] Strip file symbols with --strip-unneeded
Eugene Leviant [Tue, 21 May 2019 09:09:33 +0000 (09:09 +0000)]
[llvm-objcopy] Strip file symbols with --strip-unneeded

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

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

5 years ago[AArch64][SVE2] Asm: add integer unary instructions (predicated)
Cullen Rhodes [Tue, 21 May 2019 09:06:51 +0000 (09:06 +0000)]
[AArch64][SVE2] Asm: add integer unary instructions (predicated)

Summary:
Patch adds support for the following instructions:

    * URECPE, URSQRTE, SQABS, SQNEG

The specification can be found here:
https://developer.arm.com/docs/ddi0602/latest

Reviewed By: SjoerdMeijer

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

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

5 years ago[AArch64][SVE2] Asm: add integer pairwise arithmetic instructions
Cullen Rhodes [Tue, 21 May 2019 08:59:00 +0000 (08:59 +0000)]
[AArch64][SVE2] Asm: add integer pairwise arithmetic instructions

Summary:
Patch adds support for the following instructions:

    ADDP, SMAXP, UMAXP, SMINP, UMINP

The specification can be found here:
https://developer.arm.com/docs/ddi0602/latest

Reviewed By: SjoerdMeijer

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

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

5 years ago[ARM][CGP] Skip nuw in PrepareConstants
Sam Parker [Tue, 21 May 2019 07:56:47 +0000 (07:56 +0000)]
[ARM][CGP] Skip nuw in PrepareConstants

PrepareConstants step converts add/sub with 'negative' immediates to
sub/add with a 'positive' imm to make promotion more simple. nuw
already states that the add shouldn't cause an unsigned wrap, so
it shouldn't need any tweaking. Plus, we also don't allow a sub with
a 'negative' immediate to be safe wrap, so this functionality has
been removed. The PrepareConstants step now just handles the add
instructions that we've determined would be safe if they wrap around
zero.

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

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

5 years ago[CMake] Specify component for all target types
Petr Hosek [Tue, 21 May 2019 07:13:58 +0000 (07:13 +0000)]
[CMake] Specify component for all target types

This addresses an issue introduced in r360230 which broke existing
use cases of LLVM_DISTRIBUTION_COMPONENTS since ARCHIVE and LIBRARY
target types are no longer handled as components.

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

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

5 years agoAdd TargetLoweringInfo hook for explicitly setting the ABI calling convention endianess
Dylan McKay [Tue, 21 May 2019 06:38:02 +0000 (06:38 +0000)]
Add TargetLoweringInfo hook for explicitly setting the ABI calling convention endianess

Summary:
The endianess used in the calling convention does not always match the
endianess of the target on all architectures, namely AVR.

When an argument is too large to be legalised by the architecture and is
split for the ABI, a new hook TargetLoweringInfo::shouldSplitFunctionArgumentsAsLittleEndian
is queried to find the endianess that function arguments must be laid
out in.

This approach was recommended by Eli Friedman.

Originally reported in https://github.com/avr-rust/rust/issues/129.

Patch by Carl Peto.

Reviewers: bogner, t.p.northover, RKSimon, niravd, efriedma

Reviewed By: efriedma

Subscribers: JDevlieghere, llvm-commits

Tags: #llvm

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

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

5 years ago[NFC][PowerPC] Add a test to verify if the scheduler schedule the addi before the...
QingShan Zhang [Tue, 21 May 2019 06:32:31 +0000 (06:32 +0000)]
[NFC][PowerPC] Add a test to verify if the scheduler schedule the addi before the load.

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

5 years agoMove thumbv7k test from AArch64 to ARM
Nikita Popov [Tue, 21 May 2019 06:24:36 +0000 (06:24 +0000)]
Move thumbv7k test from AArch64 to ARM

As pointed out by charukcs on rL361166, this test uses an ARM triple.

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

5 years ago[PowerPC] test cases for selecting x-form instruction for unaligned offset - NFC
Chen Zheng [Tue, 21 May 2019 05:06:09 +0000 (05:06 +0000)]
[PowerPC] test cases for selecting x-form instruction for unaligned offset - NFC

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

5 years ago[PowerPC] use more meaningful name - NFC
Chen Zheng [Tue, 21 May 2019 03:54:42 +0000 (03:54 +0000)]
[PowerPC] use more meaningful name - NFC

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

5 years ago[ORC] Assert that JITDylibs have unique names.
Lang Hames [Tue, 21 May 2019 03:23:08 +0000 (03:23 +0000)]
[ORC] Assert that JITDylibs have unique names.

Patch by Praveen Velliengiri. Thanks Praveen!

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

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

5 years agoTweaks for setting CMAKE_LINKER to lld-link
Nico Weber [Tue, 21 May 2019 03:01:01 +0000 (03:01 +0000)]
Tweaks for setting CMAKE_LINKER to lld-link

- Just look for "lld-link", not "lld-link.exe".
  llvm/cmake/platforms/WinMsvc.cmake for example sets CMAKE_LINKER to
  lld-link without .exe

- Stop passing -gwarf to the compiler in sanitizer options when lld is
  enabled -- there's no reason to use different debug information keyed
  off the linker. (If this was for MinGW, we should check for that
  instead.)

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

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

5 years agoTry to fix build with older gccs after r361152
Nico Weber [Tue, 21 May 2019 00:27:26 +0000 (00:27 +0000)]
Try to fix build with older gccs after r361152

Also merge the cmake change there to the gn build.

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

5 years ago[ORC] fix use-after-move. NFC
Nick Desaulniers [Mon, 20 May 2019 22:17:43 +0000 (22:17 +0000)]
[ORC] fix use-after-move. NFC

Summary:
scan-build flagged a potential use-after-move in debug builds.  It's not
safe that a moved from value contains anything but garbage.  Manually
DRY up these repeated expressions.

Reviewers: lhames

Reviewed By: lhames

Subscribers: hiraditya, llvm-commits, srhines

Tags: #llvm

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

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

5 years agoAMDGPU: Force skip branches over calls
Matt Arsenault [Mon, 20 May 2019 22:04:42 +0000 (22:04 +0000)]
AMDGPU: Force skip branches over calls

Unfortunately the way SIInsertSkips works is backwards, and is
required for correctness. r338235 added handling of some special cases
where skipping is mandatory to avoid side effects if no lanes are
active. It conservatively handled asm correctly, but the same logic
needs to apply to calls.

Usually the call sequence code is larger than the skip threshold,
although the way the count is computed is really broken, so I'm not
sure if anything was likely to really hit this.

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

5 years ago[docs] Fix an RST typo: "code-blocks" should be "code-block".
Lang Hames [Mon, 20 May 2019 21:33:25 +0000 (21:33 +0000)]
[docs] Fix an RST typo: "code-blocks" should be "code-block".

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

5 years ago[ORC] Remove some unreachable code.
Lang Hames [Mon, 20 May 2019 21:30:33 +0000 (21:30 +0000)]
[ORC] Remove some unreachable code.

Fixes http://llvm.org/PR41662.

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

5 years ago[docs] Add more details/examples for LLJIT/LLLazyJIT, tweak lookup discussion.
Lang Hames [Mon, 20 May 2019 21:07:16 +0000 (21:07 +0000)]
[docs] Add more details/examples for LLJIT/LLLazyJIT, tweak lookup discussion.

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

5 years ago[NFC][InstCombine] Add FIXME for one-use check on constant negation transforms.
Cameron McInally [Mon, 20 May 2019 21:00:42 +0000 (21:00 +0000)]
[NFC][InstCombine] Add FIXME for one-use check on constant negation transforms.

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

5 years ago[Support] Renamed member 'Size' to 'AllocatedSize' in MemoryBlock and OwningMemoryBlock.
Lang Hames [Mon, 20 May 2019 20:53:05 +0000 (20:53 +0000)]
[Support] Renamed member 'Size' to 'AllocatedSize' in MemoryBlock and OwningMemoryBlock.

Rename member 'Size' to 'AllocatedSize' in order to provide a hint that the
allocated size may be different than the requested size. Comments are added to
clarify this point.  Updated the InMemoryBuffer in FileOutputBuffer.cpp to track
the requested buffer size.

Patch by Machiel van Hooren. Thanks Machiel!

https://reviews.llvm.org/D61599

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

5 years ago[AArch64] Handle lowering lround on windows, where long is 32 bit
Martin Storsjo [Mon, 20 May 2019 19:53:28 +0000 (19:53 +0000)]
[AArch64] Handle lowering lround on windows, where long is 32 bit

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

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

5 years agogn build: Merge r361148
Nico Weber [Mon, 20 May 2019 19:33:32 +0000 (19:33 +0000)]
gn build: Merge r361148

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

5 years ago[LFTR] Add additional PR31181 test cases
Nikita Popov [Mon, 20 May 2019 19:13:04 +0000 (19:13 +0000)]
[LFTR] Add additional PR31181 test cases

One case where overflow happens in the first loop iteration, and
two cases where we switch to a dynamically dead IV with post/pre
increment, respectively.

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

5 years ago[InstCombine] Add visitFNeg(...) visitor for unary Fneg
Cameron McInally [Mon, 20 May 2019 19:10:30 +0000 (19:10 +0000)]
[InstCombine] Add visitFNeg(...) visitor for unary Fneg

Also, break out a helper function, namely foldFNegIntoConstant(...), which performs transforms common between visitFNeg(...) and visitFSub(...).

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

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

5 years ago[TableGen] - Type comparison LE should be LT or equal.
Pete Couperus [Mon, 20 May 2019 18:09:37 +0000 (18:09 +0000)]
[TableGen] - Type comparison LE should be LT or equal.

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

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

5 years ago[InstCombine] auto-generate test checks; NFC
Sanjay Patel [Mon, 20 May 2019 17:52:22 +0000 (17:52 +0000)]
[InstCombine] auto-generate test checks; NFC

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

5 years ago[InstSimplify] update stale comment; NFC
Sanjay Patel [Mon, 20 May 2019 17:52:18 +0000 (17:52 +0000)]
[InstSimplify] update stale comment; NFC

Missed this diff with rL361118.

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

5 years ago[X86] Add test case for r361177.
Craig Topper [Mon, 20 May 2019 17:37:52 +0000 (17:37 +0000)]
[X86] Add test case for r361177.

That commit makes sure we flush PendingExports in SelectDAGBuilder
before we create INLINEASM_BR. Unfortunatley, I haven't yet found
a CodeGen failure without that change.

This commit uses the debug output from SelectionDAG to at least
ensure we build the DAG correctly.

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

5 years ago[SelectionDAGBuilder] Flush PendingExports before creating INLINEASM_BR node for...
Craig Topper [Mon, 20 May 2019 17:08:02 +0000 (17:08 +0000)]
[SelectionDAGBuilder] Flush PendingExports before creating INLINEASM_BR node for asm goto.

Since INLINEASM_BR is a terminator we need to flush the pending exports before
emitting it. If we don't do this, a TokenFactor can be inserted between it and
the BR instruction emitted to finish the callbr lowering.

It looks like nodes are glued to the INLINEASM_BR so I had to make sure we emit
the TokenFactor before that.

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

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

5 years ago[DWARF] hoist nullptr checks. NFC
Nick Desaulniers [Mon, 20 May 2019 16:58:59 +0000 (16:58 +0000)]
[DWARF] hoist nullptr checks. NFC

Summary:
This was flagged in https://www.viva64.com/en/b/0629/ under "Snippet No.
15" (see under #13). It looks like PVS studio flags nullptr checks where
the ptr is used inbetween creation and checking against nullptr.

Reviewers: JDevlieghere, probinson

Reviewed By: JDevlieghere

Subscribers: RKSimon, hiraditya, llvm-commits, srhines

Tags: #llvm

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

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

5 years ago[X86] Add icelake-client and tremont model numbers to getHostCPUName.
Craig Topper [Mon, 20 May 2019 16:58:23 +0000 (16:58 +0000)]
[X86] Add icelake-client and tremont model numbers to getHostCPUName.

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

5 years ago[INLINER] allow inlining of blockaddresses if sole uses are callbrs
Nick Desaulniers [Mon, 20 May 2019 16:48:09 +0000 (16:48 +0000)]
[INLINER] allow inlining of blockaddresses if sole uses are callbrs

Summary:
It was supposed that Ref LazyCallGraph::Edge's were being inserted by
inlining, but that doesn't seem to be the case.  Instead, it seems that
there was no test for a blockaddress Constant in an instruction that
referenced the function that contained the instruction. Ex:

```
define void @f() {
  %1 = alloca i8*, align 8
2:
  store i8* blockaddress(@f, %2), i8** %1, align 8
  ret void
}
```

When iterating blockaddresses, do not add the function they refer to
back to the worklist if the blockaddress is referring to the contained
function (as opposed to an external function).

Because blockaddress has sligtly different semantics than GNU C's
address of labels, there are 3 cases that can occur with blockaddress,
where only 1 can happen in GNU C due to C's scoping rules:
* blockaddress is within the function it refers to (possible in GNU C).
* blockaddress is within a different function than the one it refers to
(not possible in GNU C).
* blockaddress is used in to declare a global (not possible in GNU C).

The second case is tested in:

```
$ ./llvm/build/unittests/Analysis/AnalysisTests \
  --gtest_filter=LazyCallGraphTest.HandleBlockAddress
```

This patch adjusts the iteration of blockaddresses in
LazyCallGraph::visitReferences to not revisit the blockaddresses
function in the first case.

The Linux kernel contains code that's not semantically valid at -O0;
specifically code passed to asm goto. It requires that asm goto be
inline-able. This patch conservatively does not attempt to handle the
more general case of inlining blockaddresses that have non-callbr users
(pr/39560).

https://bugs.llvm.org/show_bug.cgi?id=39560
https://bugs.llvm.org/show_bug.cgi?id=40722
https://github.com/ClangBuiltLinux/linux/issues/6
https://reviews.llvm.org/rL212077

Reviewers: jyknight, eli.friedman, chandlerc

Reviewed By: chandlerc

Subscribers: george.burgess.iv, nathanchance, mgorny, craig.topper, mengxu.gatech, void, mehdi_amini, E5ten, chandlerc, efriedma, eraman, hiraditya, haicheng, pirama, llvm-commits, srhines

Tags: #llvm

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

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

5 years ago[AMDGPU] Fix std::array initializers to avoid warnings with older tool chains. NFC
Bjorn Pettersson [Mon, 20 May 2019 16:41:08 +0000 (16:41 +0000)]
[AMDGPU] Fix std::array initializers to avoid warnings with older tool chains. NFC

A std::array is implemented as a template with an array
inside a struct. Older versions of clang, like 3.6,
require an extra set of curly braces around std::array
initializations to avoid warnings.

The C++ language was changed regarding this by CWG 1270.
So more modern tool chains does not complaing even if
leaving out one level of braces.

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

5 years ago[Intrinsics] Merge lround.i32 and lround.i64 into a single intrinsic with overloaded...
Craig Topper [Mon, 20 May 2019 16:27:09 +0000 (16:27 +0000)]
[Intrinsics] Merge lround.i32 and lround.i64 into a single intrinsic with overloaded result type. Make result type for llvm.llround overloaded instead of fixing to i64

We shouldn't really make assumptions about possible sizes for long and long long. And longer term we should probably support vectorizing these intrinsics. By making the result types not fixed we can support vectors as well.

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

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

5 years ago[DAGCombiner] Refactor code in visitShiftByConstant slightly to make it more readable...
Craig Topper [Mon, 20 May 2019 16:26:55 +0000 (16:26 +0000)]
[DAGCombiner] Refactor code in visitShiftByConstant slightly to make it more readable. NFC

This changes the isShift variable to include the constant operand
check that was previously in the if statement.

While there fix an 80 column violation and an unnecessary use of
getNode. Also fix variable name capitalization.

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

5 years agoR600: Fix unconditional return in loop
Matt Arsenault [Mon, 20 May 2019 16:22:11 +0000 (16:22 +0000)]
R600: Fix unconditional return in loop

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

5 years ago[SDAG] Vector op legalization for overflow ops
Nikita Popov [Mon, 20 May 2019 16:09:22 +0000 (16:09 +0000)]
[SDAG] Vector op legalization for overflow ops

Fixes issue reported by aemerson on D57348. Vector op legalization
support is added for uaddo, usubo, saddo and ssubo (umulo and smulo
were already supported). As usual, by extracting TargetLowering methods
and calling them from vector op legalization.

Vector op legalization doesn't really deal with multiple result nodes,
so I'm explicitly performing a recursive legalization call on the
result value that is not being legalized.

There are some existing test changes because expansion happens
earlier, so we don't get a DAG combiner run in between anymore.

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

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

5 years ago[llvm-readelf] - Rework how we parse the .dynamic section.
George Rimar [Mon, 20 May 2019 15:41:48 +0000 (15:41 +0000)]
[llvm-readelf] - Rework how we parse the .dynamic section.

This is a result of what I found during my work on https://bugs.llvm.org/show_bug.cgi?id=41679.

Previously LLVM readelf took the information about .dynamic section
from its PT_DYNAMIC segment only. GNU tools have a bit different logic.
They also use the information from the .dynamic section header if it is available.
This patch changes the code to improve the compatibility with the GNU Binutils.

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

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

5 years agoRegAlloc: Fix verifier error with undef identity copies
Matt Arsenault [Mon, 20 May 2019 14:09:36 +0000 (14:09 +0000)]
RegAlloc: Fix verifier error with undef identity copies

The code did not match the example in the comment, and was checking
the undef flag on the copy dest instead of source. The existing tests
were only hitting the > 2 operands case.

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

5 years agoFixed the Bindings/OCaml/core.ml test
Dmitri Gribenko [Mon, 20 May 2019 14:06:21 +0000 (14:06 +0000)]
Fixed the Bindings/OCaml/core.ml test

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

5 years ago[AArch64][SVE2] Asm: add SADALP and UADALP instructions
Cullen Rhodes [Mon, 20 May 2019 13:50:15 +0000 (13:50 +0000)]
[AArch64][SVE2] Asm: add SADALP and UADALP instructions

Summary:
This patch adds support for the integer pairwise add and accumulate long
instructions SADALP/UADALP. These instructions are predicated.

The specification can be found here:
https://developer.arm.com/docs/ddi0602/latest

Reviewed By: SjoerdMeijer

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

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

5 years agogn build: Merge r361152
Nico Weber [Mon, 20 May 2019 13:46:42 +0000 (13:46 +0000)]
gn build: Merge r361152

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

5 years ago[InstSimplify] Teach fsub -0.0, (fneg X) ==> X about unary fneg
Cameron McInally [Mon, 20 May 2019 13:13:35 +0000 (13:13 +0000)]
[InstSimplify] Teach fsub -0.0, (fneg X) ==> X about unary fneg

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

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

5 years agoResubmit "[DebugInfo] Update loop metadata for inlined loops"
Orlando Cazalet-Hyams [Mon, 20 May 2019 13:02:30 +0000 (13:02 +0000)]
Resubmit "[DebugInfo] Update loop metadata for inlined loops"

This reverts commit 95805bc425b264805a472232a75ed2ffe58aceda.
I've squashed the test fix into this commit.

[DebugInfo] Update loop metadata for inlined loops

Currently, when a loop is cloned while inlining function (A) into function (B)
the loop metadata is copied and then not modified at all. The loop metadata can
encode the loop's start and end DILocations. Therefore, the new inlined loop in
function (B) may have loop metadata which shows start and end locations residing
in function (A).

This patch ensures loop metadata is updated while inlining so that the start and
end DILocations are given the "inlinedAt" operand. I've also added a regression
test for this.

This fix is required for D60831 because that patch uses loop metadata to
determine the DILocation for the branches of new loop preheaders.

Reviewers: aprantl, dblaikie, anemet

Reviewed By: aprantl

Subscribers: eraman, hiraditya, llvm-commits

Tags: #debug-info, #llvm

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

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

5 years agoRevert "[DebugInfo] Update loop metadata for inlined loops"
Orlando Cazalet-Hyams [Mon, 20 May 2019 11:24:39 +0000 (11:24 +0000)]
Revert "[DebugInfo] Update loop metadata for inlined loops"

This reverts commit 6e8f1a80cd988db8870aff9c3bc2ca7a20e04104.
Reverting patch while investigating build bot failure.

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

5 years ago[NFC] Refactor visitIntrinsicCall so it doesn't return a const char*
Guillaume Chatelet [Mon, 20 May 2019 11:01:30 +0000 (11:01 +0000)]
[NFC] Refactor visitIntrinsicCall so it doesn't return a const char*

Summary: API simplification

Reviewers: courbet

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

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

5 years ago[DebugInfoMetadata] Refactor DIExpression::prepend constants (NFC)
Petar Jovanovic [Mon, 20 May 2019 10:35:57 +0000 (10:35 +0000)]
[DebugInfoMetadata] Refactor DIExpression::prepend constants (NFC)

Refactor DIExpression::With* into a flag enum in order to be less
error-prone to use (as discussed on D60866).

Patch by Djordje Todorovic.

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

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

5 years ago[AArch64][SVE2] Asm: add int halving add/sub (predicated) instructions
Cullen Rhodes [Mon, 20 May 2019 10:35:23 +0000 (10:35 +0000)]
[AArch64][SVE2] Asm: add int halving add/sub (predicated) instructions

Summary:
This patch adds support for the predicated integer halving add/sub
instructions:

    * SHADD, UHADD, SRHADD, URHADD
    * SHSUB, UHSUB, SHSUBR, UHSUBR

The specification can be found here:
https://developer.arm.com/docs/ddi0602/latest

Reviewed By: rovka

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

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

5 years ago[AArch64][SVE2] Asm: add saturating multiply-add interleaved long instructions
Cullen Rhodes [Mon, 20 May 2019 10:29:48 +0000 (10:29 +0000)]
[AArch64][SVE2] Asm: add saturating multiply-add interleaved long instructions

Summary:
Patch adds support for SQDMLALBT and SQDMLSLBT instructions.

The specification can be found here:
https://developer.arm.com/docs/ddi0602/latest

Reviewed By: rovka

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

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

5 years agoUse llvm::sort. NFC
Fangrui Song [Mon, 20 May 2019 10:18:35 +0000 (10:18 +0000)]
Use llvm::sort. NFC

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

5 years agoMatch types of accumulator and result for llvm.experimental.vector.reduce.fadd/fmul
Sander de Smalen [Mon, 20 May 2019 09:54:06 +0000 (09:54 +0000)]
Match types of accumulator and result for llvm.experimental.vector.reduce.fadd/fmul

The scalar start/accumulator value of the fadd- and fmul reduction
should match the result type of the reduction, as well as the vector
element-type of the input vector. Although this was not explicitly
specified in the LangRef, it was taken for granted in code implementing
the reductions. The patch also fixes the LangRef by adding this
constraint.

Reviewed By: aemerson, nikic

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

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

5 years ago[DebugInfo] Update loop metadata for inlined loops
Orlando Cazalet-Hyams [Mon, 20 May 2019 09:40:44 +0000 (09:40 +0000)]
[DebugInfo] Update loop metadata for inlined loops

Summary:
Currently, when a loop is cloned while inlining function (A) into function (B) the loop metadata is copied and then not modified at all. The loop metadata can encode the loop's start and end DILocations. Therefore, the new inlined loop in function (B) may have loop metadata which shows start and end locations residing in function (A).

This patch ensures loop metadata is updated while inlining so that the start and end DILocations are given the "inlinedAt" operand. I've also added a regression test for this.

This fix is required for D60831 because that patch uses loop metadata to determine the DILocation for the branches of new loop preheaders.

Reviewers: aprantl, dblaikie, anemet

Reviewed By: aprantl

Subscribers: eraman, hiraditya, llvm-commits

Tags: #debug-info, #llvm

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

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

5 years agoRevert "[NFC] Refactor visitIntrinsicCall so it doesn't return a const char*"
Guillaume Chatelet [Mon, 20 May 2019 09:00:12 +0000 (09:00 +0000)]
Revert "[NFC] Refactor visitIntrinsicCall so it doesn't return a const char*"

This reverts commit 706d3cd6388cc3446aab282f3af879862b10cbed.

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

5 years ago[NFC] Refactor visitIntrinsicCall so it doesn't return a const char*
Guillaume Chatelet [Mon, 20 May 2019 08:52:10 +0000 (08:52 +0000)]
[NFC] Refactor visitIntrinsicCall so it doesn't return a const char*

Summary: API simplification

Reviewers: courbet

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

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

5 years ago[AMDGPU] gfx1010 Avoid SMEM WAR hazard for some s_waitcnt values
Carl Ritson [Mon, 20 May 2019 07:20:12 +0000 (07:20 +0000)]
[AMDGPU] gfx1010 Avoid SMEM WAR hazard for some s_waitcnt values

Summary:
Avoid introducing hazard mitigation when lgkmcnt is reduced to 0.
Clarify code comments to explain assumptions made for this hazard
mitigation.  Expand and correct test cases to cover variants of
s_waitcnt.

Reviewers: nhaehnle, rampitec

Subscribers: arsenm, kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits

Tags: #llvm

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

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

5 years agogn build: Merge r361117
Nico Weber [Mon, 20 May 2019 00:51:16 +0000 (00:51 +0000)]
gn build: Merge r361117

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

5 years ago[InstSimplify] fold fcmp (maxnum, X, C1), C2
Sanjay Patel [Sun, 19 May 2019 14:26:39 +0000 (14:26 +0000)]
[InstSimplify] fold fcmp (maxnum, X, C1), C2

This is the sibling transform for rL360899 (D61691):

  maxnum(X, GreaterC) == C --> false
  maxnum(X, GreaterC) <= C --> false
  maxnum(X, GreaterC) <  C --> false
  maxnum(X, GreaterC) >= C --> true
  maxnum(X, GreaterC) >  C --> true
  maxnum(X, GreaterC) != C --> true

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

5 years ago[SLP] Refactoring of EdgeInfo and UserTreeIdx in buildTree_rec().
Dinar Temirbulatov [Sun, 19 May 2019 01:30:41 +0000 (01:30 +0000)]
[SLP] Refactoring of EdgeInfo and UserTreeIdx in buildTree_rec().

This is a follow-up refactoring patch after the introduction of usable TreeEntry pointers in D61706.
The EdgeInfo struct can now use a TreeEntry pointer instead of an index in VectorizableTree.

Committed on behalf of @vporpo (Vasileios Porpodas)

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

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

5 years ago[X86] Remove combineShift function. Just dispatch directly to the handler for each...
Craig Topper [Sun, 19 May 2019 01:01:46 +0000 (01:01 +0000)]
[X86] Remove combineShift function. Just dispatch directly to the handler for each flavor from the main switch. NFC

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

5 years ago[CommandLine] Reduce size of Option class
Don Hinton [Sat, 18 May 2019 20:46:35 +0000 (20:46 +0000)]
[CommandLine] Reduce size of Option class

Summary:
Reduce size of Option class from 184 bytes to 136 bytes by
placing more member variables in Bit Field (16 bytes), and
reducing the initial sizes of Categories and Subs to 1 (32 bytes).

Saves about 48k for bin/opt.

Reviewed By: beanz

Tags: #llvm

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

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

5 years ago[NFC][AArch64] Autogenerate fcopysign.ll test
Roman Lebedev [Sat, 18 May 2019 20:24:40 +0000 (20:24 +0000)]
[NFC][AArch64] Autogenerate fcopysign.ll test

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

5 years ago[NFC][AArch64] Autogenerate bitfield-insert.ll, selectcc-to-shiftand.ll tests
Roman Lebedev [Sat, 18 May 2019 17:42:06 +0000 (17:42 +0000)]
[NFC][AArch64] Autogenerate bitfield-insert.ll, selectcc-to-shiftand.ll tests

Investigating bit-extract (ubfx) pattern with shifted mask.

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

5 years ago[AVR] Fix 'symbol_relocations.s' MC test
Dylan McKay [Sat, 18 May 2019 16:38:48 +0000 (16:38 +0000)]
[AVR] Fix 'symbol_relocations.s' MC test

This was broken in r360143, when the 'rela.' prefix was stripped from
section names.

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

5 years agoGVN: Handle addrspacecast
Matt Arsenault [Sat, 18 May 2019 14:36:06 +0000 (14:36 +0000)]
GVN: Handle addrspacecast

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

5 years ago[NFC][AArch64] Add some ubfx tests with immediates
Roman Lebedev [Sat, 18 May 2019 13:49:44 +0000 (13:49 +0000)]
[NFC][AArch64] Add some ubfx tests with immediates

Shows the regression in D62100

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

5 years agoUpdateTestChecks: fix AMDGPU handling
Roman Lebedev [Sat, 18 May 2019 13:00:03 +0000 (13:00 +0000)]
UpdateTestChecks: fix AMDGPU handling

Summary:
Was looking into supporting `(srl (shl x, c1), c2)` with c1 != c2 in dagcombiner,
this test changes, but makes `update_llc_test_checks.py` unhappy.

**Many** AMDGPU tests specify `-march`, not `-mtriple`, which results in `update_llc_test_checks.py`
defaulting to x86 asm function detection heuristics, which don't work here.
I propose to fix this by adding an infrastructure to map from `-march` to `-mtriple`,
in the UpdateTestChecks tooling.

Reviewers: RKSimon, MaskRay, arsenm

Reviewed By: arsenm

Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, llvm-commits

Tags: #llvm

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

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

5 years agoUpdateTestChecks: arm64-eabi handlind
Roman Lebedev [Sat, 18 May 2019 12:59:56 +0000 (12:59 +0000)]
UpdateTestChecks: arm64-eabi handlind

Summary:
Was looking into supporting `(srl (shl x, c1), c2)` with c1 != c2 in dagcombiner,
this test changes, but makes `update_llc_test_checks.py` unhappy

Reviewers: RKSimon

Reviewed By: RKSimon

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

Tags: #llvm

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

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

5 years agoMemCmpExpansion::getCompareLoadPairs - assert we find a comparison diff. NFCI.
Simon Pilgrim [Sat, 18 May 2019 11:31:48 +0000 (11:31 +0000)]
MemCmpExpansion::getCompareLoadPairs - assert we find a comparison diff. NFCI.

Fix scan-build uninitialized warning and assert the final diff isn't null.

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

5 years ago[docs] Fix some RST errors.
Lang Hames [Sat, 18 May 2019 03:23:18 +0000 (03:23 +0000)]
[docs] Fix some RST errors.

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

5 years agoUpdate llvm-nm -s to use a multi-var option
Michael Trent [Sat, 18 May 2019 03:17:27 +0000 (03:17 +0000)]
Update llvm-nm -s to use a multi-var option

Summary:
Previously llvm-nm relied on a positional parameter to read two values
into the SegSect list. This worked, but required the "-s" paramater and
its arguments to be the last elements on the command-line.

The CommandLine library now supports mutli-var parameters, so it can
naturally deal with "-s" expecting two arguments, and now the input file
can appear anywhere (within reason) in the command line invocation. E.g.

    llvm-nm -s __TEXT __text /bin/ls
    llvm-nm /bin/ls -s __TEXT __text

rdar://27284011

Reviewers: lhames, pete

Reviewed By: pete

Subscribers: rupprecht, llvm-commits

Tags: #llvm

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

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

5 years ago[docs][ORC] Start work on an ORC design doc. Very much a work in progress.
Lang Hames [Sat, 18 May 2019 03:08:49 +0000 (03:08 +0000)]
[docs][ORC] Start work on an ORC design doc. Very much a work in progress.

This initial version describes some of the high level design goals and basic
symbol lookup rules.

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

5 years agoAMDGPU/GlobalISel: Implement s64->s64 [SU]ITOFP
Matt Arsenault [Fri, 17 May 2019 23:05:18 +0000 (23:05 +0000)]
AMDGPU/GlobalISel: Implement s64->s64 [SU]ITOFP

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

5 years agoGlobalISel: Implement lower for S64->S32 [SU]ITOFP
Matt Arsenault [Fri, 17 May 2019 23:05:13 +0000 (23:05 +0000)]
GlobalISel: Implement lower for S64->S32 [SU]ITOFP

This is ported from the custom AMDGPU DAG implementation. I think this
is a better default expansion than what the DAG currently uses, at
least if the target has CTLZ.

This implements the signed version in terms of the unsigned
conversion, which is implemented with bit operations. SelectionDAG has
several other implementations that should eventually be ported
depending on what instructions are legal.

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

5 years ago[NFC][InstSimplify] Add more unary fneg tests to floating-point-arithmetic.ll
Cameron McInally [Fri, 17 May 2019 21:10:11 +0000 (21:10 +0000)]
[NFC][InstSimplify] Add more unary fneg tests to floating-point-arithmetic.ll

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

5 years agobuild: use clang-cl for runtimes when targeting Windows
Saleem Abdulrasool [Fri, 17 May 2019 20:09:06 +0000 (20:09 +0000)]
build: use clang-cl for runtimes when targeting Windows

When targeting Windows and building a runtime (subproject) prefer to use
`clang-cl` rather than the `clang` driver.  This allows us to cross-compile
runtimes for the Windows environment from Linux.

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

5 years ago[WebAssembly] Remove expected failure of builtin-location.C test
Sam Clegg [Fri, 17 May 2019 19:55:17 +0000 (19:55 +0000)]
[WebAssembly] Remove expected failure of builtin-location.C test

This seems to have been fixed by https://reviews.llvm.org/D61956

Yay

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

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

5 years agogn build: Merge r360993
Nico Weber [Fri, 17 May 2019 18:37:46 +0000 (18:37 +0000)]
gn build: Merge r360993

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

5 years agoGlobalISel: Define integer min/max instructions
Matt Arsenault [Fri, 17 May 2019 18:36:31 +0000 (18:36 +0000)]
GlobalISel: Define integer min/max instructions

Doesn't attempt to emit them for anything yet, but some legalizations
I want to port use them.

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

5 years ago[NFC][InstSimplify] Precommit new unary fneg test
Cameron McInally [Fri, 17 May 2019 18:34:35 +0000 (18:34 +0000)]
[NFC][InstSimplify] Precommit new unary fneg test

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

5 years agoRevert r361033 "Add a Visit overload for DynTypedNode to ASTNodeTraverser"
Nico Weber [Fri, 17 May 2019 18:31:24 +0000 (18:31 +0000)]
Revert r361033 "Add a Visit overload for DynTypedNode to ASTNodeTraverser"

It fails to build on some bots.

Also revert follow-up r361055.

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

5 years ago[InstCombine] move bitcast after insertelement-with-bitcasted-operands
Sanjay Patel [Fri, 17 May 2019 18:06:12 +0000 (18:06 +0000)]
[InstCombine] move bitcast after insertelement-with-bitcasted-operands

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

5 years ago[NFC][InstSImplify] Fix flip-flopped comments and test names
Cameron McInally [Fri, 17 May 2019 17:59:17 +0000 (17:59 +0000)]
[NFC][InstSImplify] Fix flip-flopped comments and test names

In test/Transforms/InstSimplify/floating-point-arithmetic.ll

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

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

5 years ago[X86][SSE] Fold movmsk(not(x)) -> not(movmsk)
Simon Pilgrim [Fri, 17 May 2019 17:56:25 +0000 (17:56 +0000)]
[X86][SSE] Fold movmsk(not(x)) -> not(movmsk)

Helps to improve folding of comparisons with movmsk results.

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

5 years agogn build: Merge r361033
Nico Weber [Fri, 17 May 2019 17:36:06 +0000 (17:36 +0000)]
gn build: Merge r361033

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

5 years agogn build: Merge r360991
Nico Weber [Fri, 17 May 2019 17:32:00 +0000 (17:32 +0000)]
gn build: Merge r360991

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

5 years ago[X86][SSE] Match all-of bool scalar reductions into a bitcast/movmsk + cmp.
Simon Pilgrim [Fri, 17 May 2019 17:25:55 +0000 (17:25 +0000)]
[X86][SSE] Match all-of bool scalar reductions into a bitcast/movmsk + cmp.

Same as what we do for vector reductions in combineHorizontalPredicateResult, use movmsk+cmp for scalar (and(extract(x,0),extract(x,1)) reduction patterns.

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

5 years ago[InstCombine] add tests for insertelement with bitcasted operands; NFC
Sanjay Patel [Fri, 17 May 2019 17:23:13 +0000 (17:23 +0000)]
[InstCombine] add tests for insertelement with bitcasted operands; NFC

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

5 years ago[InstSimplify] Add unary fneg to `fsub 0.0, (fneg X) ==> X` transform
Cameron McInally [Fri, 17 May 2019 16:47:00 +0000 (16:47 +0000)]
[InstSimplify] Add unary fneg to `fsub 0.0, (fneg X) ==> X` transform

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

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

5 years ago[AMDGPU][MC] Corrected parsing of NAME:VALUE modifiers
Dmitry Preobrazhensky [Fri, 17 May 2019 16:04:17 +0000 (16:04 +0000)]
[AMDGPU][MC] Corrected parsing of NAME:VALUE modifiers

See bug 41298: https://bugs.llvm.org/show_bug.cgi?id=41298

Reviewers: artem.tamazov, arsenm

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

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

5 years ago[DAGCombiner] visitShiftByConstant(): drop bogus signbit check
Roman Lebedev [Fri, 17 May 2019 15:52:58 +0000 (15:52 +0000)]
[DAGCombiner] visitShiftByConstant(): drop bogus signbit check

Summary:
That check claims that the transform is illegal otherwise.
That isn't true:
1. For `ISD::ADD`, we only process `ISD::SHL` outer shift => sign bit does not matter
   https://rise4fun.com/Alive/K4A
2. For `ISD::AND`, there is no restriction on constants:
   https://rise4fun.com/Alive/Wy3
3. For `ISD::OR`, there is no restriction on constants:
   https://rise4fun.com/Alive/GOH
3. For `ISD::XOR`, there is no restriction on constants:
   https://rise4fun.com/Alive/ml6

So, why is it there then?

This changes the testcase that was touched by @spatel in rL347478,
but i'm not sure that test tests anything particular?

Reviewers: RKSimon, spatel, craig.topper, jojo, rengolin

Reviewed By: spatel

Subscribers: javed.absar, llvm-commits, spatel

Tags: #llvm

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

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

5 years ago[InstCombine] canShiftBinOpWithConstantRHS(): drop bogus signbit check
Roman Lebedev [Fri, 17 May 2019 15:52:49 +0000 (15:52 +0000)]
[InstCombine] canShiftBinOpWithConstantRHS(): drop bogus signbit check

Summary:
In D61918 i was looking at dropping it in DAGCombiner `visitShiftByConstant()`,
but as @craig.topper pointed out, it was copied from here.

That check claims that the transform is illegal otherwise.
That isn't true:
1. For `ISD::ADD`, we only process `ISD::SHL` outer shift => sign bit does not matter
   https://rise4fun.com/Alive/K4A
2. For `ISD::AND`, there is no restriction on constants:
   https://rise4fun.com/Alive/Wy3
3. For `ISD::OR`, there is no restriction on constants:
   https://rise4fun.com/Alive/GOH
3. For `ISD::XOR`, there is no restriction on constants:
   https://rise4fun.com/Alive/ml6

So, why is it there then?
As far as i can tell, it dates all the way back to original check-in rL7793.
I think we should just drop it.

Reviewers: spatel, craig.topper, efriedma, majnemer

Reviewed By: spatel

Subscribers: llvm-commits, craig.topper

Tags: #llvm

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

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

5 years ago[AMDGPU][MC] Enabled labels with s_call_b64 and s_cbranch_i_fork
Dmitry Preobrazhensky [Fri, 17 May 2019 14:57:04 +0000 (14:57 +0000)]
[AMDGPU][MC] Enabled labels with s_call_b64 and s_cbranch_i_fork

See https://bugs.llvm.org/show_bug.cgi?id=41888

Reviewers: artem.tamazov, arsenm

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

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

5 years ago[X86][AVX] Remove LowerCTTZ's AVX1 custom vector handling.
Simon Pilgrim [Fri, 17 May 2019 14:37:19 +0000 (14:37 +0000)]
[X86][AVX] Remove LowerCTTZ's AVX1 custom vector handling.

We can now rely on generic expansion to handle this.

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

5 years ago[X86][AVX] isNOT - add extract_subvector(xor X, -1) -> extract_subvector(X) fold.
Simon Pilgrim [Fri, 17 May 2019 14:04:56 +0000 (14:04 +0000)]
[X86][AVX] isNOT - add extract_subvector(xor X, -1) -> extract_subvector(X) fold.

Prep work for the removal of the remaining x86 CTTZ vector lowering.

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

5 years ago[AMDGPU][MC] Enabled expressions for most operands which accept integer values
Dmitry Preobrazhensky [Fri, 17 May 2019 13:17:48 +0000 (13:17 +0000)]
[AMDGPU][MC] Enabled expressions for most operands which accept integer values

See bug 40873: https://bugs.llvm.org/show_bug.cgi?id=40873

Reviewers: artem.tamazov, arsenm

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

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

5 years agoAMDGPU: Fix unused variable warnings in release builds
Matt Arsenault [Fri, 17 May 2019 12:59:27 +0000 (12:59 +0000)]
AMDGPU: Fix unused variable warnings in release builds

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