[InstCombine] Handle vector gep with scalar argument in evaluateInDifferentElementOrder
authorMikael Holmen <mikael.holmen@ericsson.com>
Mon, 1 Apr 2019 14:10:10 +0000 (14:10 +0000)
committerMikael Holmen <mikael.holmen@ericsson.com>
Mon, 1 Apr 2019 14:10:10 +0000 (14:10 +0000)
commit150a7ec2dc04b116be15ba0dda7001d1e1de6ed7
treed5bac206618acb134318e21710c2ad44a6b9c6ab
parentebf90db0848bb0d558ff672d85ab009a7d5fbfc0
[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

llvm-svn: 357389
llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
llvm/test/Transforms/InstCombine/vec_gep_scalar_arg.ll [new file with mode: 0644]