21523 Commits

Author SHA1 Message Date
Jeremy Morse
e049fdb84b [DebugInfo] Fix pr41175 Dead Store Elimination missing debug loc
Bug: https://bugs.llvm.org/show_bug.cgi?id=41175

In the bug test case the DSE pass is shortening the range of memory that a
memset is working on. A getelementptr is generated so that the new
starting address can be passed to memset. This instruction was not given
a DebugLoc.

To fix the bug, copy the DebugLoc from the memset instruction.

Patch by Orlando Cazalet-Hyams!

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358270 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-12 09:47:35 +00:00
Fangrui Song
66987a8d19 Use llvm::lower_bound. NFC
This reapplies rL358161. That commit inadvertently reverted an exegesis file to an old version.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358246 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-12 02:02:06 +00:00
Rong Xu
c2c97e63cc [PGO] Better handling of profile hash mismatch
We currently assume profile hash conflicts will be caught by an upfront
check and we assert for the cases that escape the check. The assumption
is not always true as there are chances of conflict. This patch prints
a warning and skips annotating the function for the escaped cases,.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358225 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-11 20:54:17 +00:00
Ali Tamur
8c653aebb3 Revert "Use llvm::lower_bound. NFC"
This reverts commit rL358161.

This patch have broken the test:
llvm/test/tools/llvm-exegesis/X86/uops-CMOV16rm-noreg.s

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358199 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-11 17:35:20 +00:00
Fangrui Song
a5919957f1 Use llvm::lower_bound. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358161 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-11 10:25:41 +00:00
Nikita Popov
bea42108cf [InstCombine] Handle ssubo always overflow
Following D60483 and D60497, this adds support for AlwaysOverflows
handling for ssubo. This is the last case we can handle right now.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358100 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-10 16:32:15 +00:00
Nikita Popov
7604f64a6f [InstCombine] ssubo X, C -> saddo X, -C
ssubo X, C is equivalent to saddo X, -C. Make the transformation in
InstCombine and allow the logic implemented for saddo to fold prior
usages of add nsw or sub nsw with constants.

Patch by Dan Robertson.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358099 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-10 16:27:36 +00:00
Nikita Popov
84db5e0028 [InstCombine] Handle saddo always overflow
Followup to D60483: Handle AlwaysOverflow conditions for saddo as
well.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358095 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-10 16:18:01 +00:00
Florian Hahn
9928b761ce [VPLAN] Minor improvement to testing and debug messages.
1. Use computed VF for stress testing.
2. If the computed VF does not produce vector code (VF smaller than 2), force VF to be 4.
3. Test vectorization of i64 data on AArch64 to make sure we generate VF != 4 (on X86 that was already tested on AVX).

Patch by Francesco Petrogalli <francesco.petrogalli@arm.com>

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358056 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-10 08:17:28 +00:00
Nikita Popov
b8b80606ab [InstCombine] Handle usubo always overflow
Check AlwaysOverflow condition for usubo. The implementation is the
same as the existing handling for uaddo and umulo. Handling for saddo
and ssubo will follow (smulo doesn't have the necessary ValueTracking
support).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358052 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-10 07:10:53 +00:00
Nikita Popov
ce68404678 [InstCombine] Directly call computeOverflow methods in OptimizeOverflowCheck; NFC
Instead of using the willOverflow helpers. This makes it easier to
extend handling of AlwaysOverflows.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358051 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-10 07:10:44 +00:00
Chen Zheng
29ea2070bd [InstCombine] Canonicalize (-X s/ Y) to -(X s/ Y).
Differential Revision: https://reviews.llvm.org/D60395


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358050 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-10 06:52:09 +00:00
Akira Hatanaka
9eaa79da9e [ObjC][ARC] Convert the retainRV marker that is passed as a named
metadata into a module flag in the auto-upgrader and make the ARC
contract pass read the marker as a module flag.

This is needed to fix a bug where ARC contract wasn't inserting the
retainRV marker when LTO was enabled, which caused objects returned
from a function to be auto-released.

rdar://problem/49464214

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358047 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-10 06:20:20 +00:00
Nikita Popov
338bf21006 Revert "[InstCombine] [InstCombine] Canonicalize (-X s/ Y) to -(X s/ Y)."
This reverts commit 1383a9168948aabfd827220c9445ce0ce5765800.

sdiv-canonicalize.ll fails after this revision. The fold needs to be
moved outside the branch handling constant operands. However when this
is done there are further test changes, so I'm reverting this in the
meantime.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358026 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-09 18:32:38 +00:00
Nikita Popov
b9767f7ec0 [InstCombine] Restructure OptimizeOverflowCheck; NFC
Change the code to always handle the unsigned+signed cases together
with the same basic structure for add/sub/mul. The simple folds are
always handled first and then the ValueTracking overflow checks are
used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358025 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-09 18:32:28 +00:00
Chen Zheng
c92ab7af6f [InstCombine] [InstCombine] Canonicalize (-X s/ Y) to -(X s/ Y).
Differential Revision: https://reviews.llvm.org/D60395


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358017 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-09 16:34:31 +00:00
Sanjay Patel
38daa71a61 [InstCombine] prevent possible miscompile with sdiv+negate of vector op
Similar to:
rL358005

Forego folding arbitrary vector constants to fix a possible miscompile bug.
We can enhance the transform if we do want to handle the more complicated
vector case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358013 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-09 15:13:03 +00:00
Sanjay Patel
30ccf8222e [InstCombine] prevent possible miscompile with negate+sdiv of vector op
// 0 - (X sdiv C)  -> (X sdiv -C)  provided the negation doesn't overflow.

This fold has been around for many years and nobody noticed the potential
vector miscompile from overflow until recently...
So it seems unlikely that there's much demand for a vector sdiv optimization
on arbitrary vector constants, so just limit the matching to splat constants
to avoid the possible bug.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358005 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-09 14:09:06 +00:00
Peter Collingbourne
2accefaaf3 hwasan: Enable -hwasan-allow-ifunc by default.
It's been on in Android for a while without causing problems, so it's time
to make it the default and remove the flag.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357960 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-09 00:25:59 +00:00
Sanjay Patel
44ffd2ca9e [InstCombine] peek through fdiv to find a squared sqrt
A more general canonicalization between fdiv and fmul would not
handle this case because that would have to be limited by uses
to prevent 2 values from becoming 3 values:
(x/y) * (x/y) --> (x*x) / (y*y)

(But we probably should still have that limited -- but more general --
canonicalization independently of this change.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357943 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-08 21:23:50 +00:00
Brian M. Rzycki
954fc5a625 [JumpThreading] Fix incorrect fold conditional after indirectbr/callbr
Fixes bug 40992: https://bugs.llvm.org/show_bug.cgi?id=40992

There is potential for miscompiled code emitted from JumpThreading when
analyzing a block with one or more indirectbr or callbr predecessors. The
ProcessThreadableEdges() function incorrectly folds conditional branches
into an unconditional branch.

This patch prevents incorrect branch folding without fully pessimizing
other potential threading opportunities through the same basic block.

This IR shape was manually fed in via opt and is unclear if clang and the
full pass pipeline will ever emit similar code shapes.

Thanks to Matthias Liedtke for the bug report and simplified IR example.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357930 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-08 18:20:35 +00:00
Sanjay Patel
f2bfd1e2c6 [InstCombine] remove overzealous assert for shuffles (PR41419)
As the TODO indicates, instsimplify could be improved.

Should fix:
https://bugs.llvm.org/show_bug.cgi?id=41419

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357910 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-08 13:28:29 +00:00
Simon Pilgrim
f9c39ac584 [InstCombine][X86] Expand MOVMSK to generic IR (PR39927)
First step towards removing the MOVMSK intrinsics completely - this patch expands MOVMSK to the pattern:

e.g. PMOVMSKB(v16i8 x):
%cmp = icmp slt <16 x i8> %x, zeroinitializer
%int = bitcast <16 x i8> %cmp to i16
%res = zext i16 %int to i32

Which is correctly handled by ISel and FastIsel (give or take an annoying movzx move....): https://godbolt.org/z/rkrSFW

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357909 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-08 13:17:51 +00:00
Chen Zheng
ef1e756a76 [InstCombine] sdiv exact flag fixup.
Differential Revision: https://reviews.llvm.org/D60396


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357904 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-08 12:08:03 +00:00
Fangrui Song
360e56327d Change some dyn_cast to more apropriate isa. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357773 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-05 16:16:23 +00:00
Evandro Menezes
d71ea05ab7 [IR] Refactor attribute methods in Function class (NFC)
Rename the functions that query the optimization kind attributes.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357731 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-04 22:40:06 +00:00
Luqman Aden
0f925da273 [InstCombine] Combine no-wrap sub and icmp w/ constant.
Teach InstCombine the transformation `(icmp P (sub nuw|nsw C2, Y), C) -> (icmp swap(P) Y, C2-C)`

Reviewers: majnemer, apilipenko, sanjoy, spatel, lebedev.ri

Reviewed By: lebedev.ri

Subscribers: dmgreen, lebedev.ri, nikic, hiraditya, JDevlieghere, jfb, jdoerfert, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357674 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-04 07:08:30 +00:00
David L. Jones
a8e2ae4a63 Revert r357452 - 'SimplifyCFG SinkCommonCodeFromPredecessors: Also sink function calls without used results (PR41259)'
This revision causes tests to fail under ASAN. Since the cause of the failures
is not clear (could be ASAN, could be a Clang bug, could be a bug in this
revision), the safest course of action seems to be to revert while investigating.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357667 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-04 02:27:57 +00:00
Evandro Menezes
6782017317 [IR] Create new method in Function class (NFC)
Create method `optForNone()` testing for the function level equivalent of
`-O0` and refactor appropriately.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357638 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-03 21:27:03 +00:00
David Bolvansky
1e8e0fd0ea [InstCombine] Simplify ctpop with bitreverse/bswap
Summary: Fixes PR41337

Reviewers: spatel

Reviewed By: spatel

Subscribers: llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357564 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-03 08:08:44 +00:00
Alon Zakai
683212b71c [WebAssembly] Add Emscripten OS definition + small_printf
The Emscripten OS provides a definition of __EMSCRIPTEN__, and also that it
supports iprintf optimizations.

Also define small_printf optimizations, which is a printf with float support
but not long double (which in wasm can be useful since long doubles are 128
bit and force linking of float128 emulation code). This part is based on
sunfish's https://reviews.llvm.org/D57620 (which can't land yet since
the WASI integration isn't ready yet).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357552 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-03 01:08:35 +00:00
David Bolvansky
ceabbb96bf [InstCombine] Simplify ctlz/cttz with bitreverse
Summary: Fixes PR41273

Reviewers: spatel

Reviewed By: spatel

Subscribers: llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357521 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-02 20:13:28 +00:00
Vedant Kumar
9f961da60e [ArgPromotion] Set debug location at updated callsites
Set the correct debug location on instructions which load arguments in
preparation for a call to an arg-promoted function.

This prevents location cascade from misattributing the line/scope of one
of these loads to the location of the instruction preceding the call.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357500 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-02 17:42:17 +00:00
Vedant Kumar
3bc14040b5 [DebugInfo] Fix pr41180 : Loop Vectorization Debugify Failure
Bug: https://bugs.llvm.org/show_bug.cgi?id=41180

In the bug test case the debug location was missing for the cmp instruction in
the "middle block" BB. This patch fixes the bug by copying the debug location
from the cmp of the scalar loop's terminator branch, if it exists.

The patch also fixes the debug location on the subsequent branch instruction.
It was previously using the location of the of the original loop's pre-header
block terminator. Both of these instructions will now map to the source line of
the conditional branch in the original loop.

A regression test has been added that covers these issues.

Patch by Orlando Cazalet-Hyams!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357499 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-02 17:28:34 +00:00
Simon Pilgrim
81ead47d20 [SLP] reorderInputsAccordingToOpcode is const method. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357490 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-02 16:27:11 +00:00
Joseph Tremoulet
85027ee656 [SimplifyCFG] Don't split musttail call from ret
Summary:
When inserting an `unreachable` after a noreturn call, we must ensure
that it's not a musttail call to avoid breaking the IR invariants for
musttail calls.

Reviewers: fedor.sergeev, majnemer

Reviewed By: majnemer

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357485 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-02 15:48:58 +00:00
Taewook Oh
2b32e0123f [SampleProfile] Repeat indirect call promotion only when the target is actually hot.
Summary: It is possible that multiple indirect call targets have been promoted for a single callsite from the profiled binary. Current implementation repeats promotion for all these targets as far as the callsite itself is hot (the callsite is assumed to be hot if any one of these targets was "hot" during the profiling). However, even when one of the ICPed target is hot other targets may not, and we should not repeat promotion for "cold" targets.

Reviewers: danielcdh, wmi

Subscribers: hiraditya, jdoerfert, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357484 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-02 15:48:21 +00:00
Joseph Tremoulet
5fc1c8d59b [PruneEH] Don't split musttail call from ret
Summary:
When inserting an `unreachable` after a noreturn call, we must ensure
that it's not a musttail call to avoid breaking the IR invariants for
musttail calls.

Reviewers: fedor.sergeev, majnemer

Reviewed By: majnemer

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357483 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-02 15:47:11 +00:00
Brian Gesiak
b0d0b07731 [Transforms] Redundant getValueOperand (NFC)
`StoreInst::getValueOperand` is identical to `getOperand(0)`, so the call to
`getOperand(0)` can be replaced. Further, `SI->getValueOperand` is redundantly
called just a few lines down, despite its return value being stored in variable
`DV`. No functional change.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357479 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-02 14:57:56 +00:00
Fangrui Song
8c3a3205cc [Internalize] Replace uses of std::set with DenseSet
This makes it faster and saves 104 bytes for my build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357458 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-02 09:25:31 +00:00
Fangrui Song
5377f1995b [Internalize] Replace fstream with line_iterator for -internalize-public-api-file
This makes my libLLVMipo.so.9svn smaller by 360 bytes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357457 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-02 09:11:18 +00:00
Hans Wennborg
8abcd76492 SimplifyCFG SinkCommonCodeFromPredecessors: Also sink function calls without used results (PR41259)
The code was previously checking that candidates for sinking had exactly
one use or were a store instruction (which can't have uses). This meant
we could sink call instructions only if they had a use.

That limitation seemed a bit arbitrary, so this patch changes it to
"instruction has zero or one use" which seems more natural and removes
the need to special-case stores.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357452 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-02 08:01:38 +00:00
Philip Reames
2f2c88671c [LoopPredication] Simplify widenable condition handling [NFC]
The code doesn't actually need any of the information about the widenable condition at this level.  The only thing we need is to ensure the WC call is the last thing anded in, and even that is a quirk we should really look to remove.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357448 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-02 02:42:57 +00:00
Philip Reames
4513bbfe09 [LoopPred] Rename a variable to simply a future patch [NFC]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357433 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-01 22:39:54 +00:00
Nick Lewycky
59ed9c6f41 [NFC] Remove dead parameter "FreeInLoop", fix some typos and trailing whitespace.
Differential Revision: https://reviews.llvm.org/D60084


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357427 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-01 20:37:56 +00:00
Simon Pilgrim
f06123b2a8 [SLP] getVectorElementSize and isTreeTinyAndNotFullyVectorizable are const methods. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357416 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-01 17:48:03 +00:00
Simon Pilgrim
a15fff454f [SLP] getGatherCost and isFullyVectorizableTinyTree are const methods. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357414 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-01 17:32:46 +00:00
Philip Reames
a3d1fd2535 [LoopPred] Be uniform about proving generated conditions
We'd been optimizing the case where the predicate was obviously true, do the same for the false case.  Mostly just for completeness sake, but also may improve compile time in loops which will exit through the guard.  Such loops are presumed rare in fastpath code, but may be present down untaken paths, so optimizing for them is still useful.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357408 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-01 16:26:08 +00:00
Philip Reames
071b5c0eb5 [LoopPred] Delete the old condition expressions if unused
LoopPredication was replacing the original condition, but leaving the instructions to compute the old conditions around.  This would get cleaned up by other passes of course, but we might as well do it eagerly.  That also makes the test output less confusing.  



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357406 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-01 16:05:15 +00:00
Mikael Holmen
74746501d3 [InstCombine] Handle vector gep with scalar argument in evaluateInDifferentElementOrder
Summary:
This fixes PR41270.

The recursive function evaluateInDifferentElementOrder expects to be called
on a vector Value, so when we call it on a vector GEP's arguments, we must
first check that the argument is indeed a vector.

Reviewers: reames, spatel

Reviewed By: spatel

Subscribers: llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357389 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-01 14:10:10 +00:00