diff options
author | Joey Gouly <joey.gouly@arm.com> | 2013-07-12 23:08:06 +0000 |
---|---|---|
committer | Joey Gouly <joey.gouly@arm.com> | 2013-07-12 23:08:06 +0000 |
commit | ebe11477225cc2793b43073bddc17f484839e006 (patch) | |
tree | 7c1d2eec791522d800dbdfa9d8daec21d2c8ebea /lib/Transforms | |
parent | ae24f7d3c6770fb32eb1f6215bab1fc92cbe2d94 (diff) | |
download | external_llvm-ebe11477225cc2793b43073bddc17f484839e006.zip external_llvm-ebe11477225cc2793b43073bddc17f484839e006.tar.gz external_llvm-ebe11477225cc2793b43073bddc17f484839e006.tar.bz2 |
Fix a crash in EvaluateInDifferentElementOrder where it would generate an
undef vector of the wrong type.
LGTM'd by Nick Lewycky on IRC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186224 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/InstCombine/InstCombineVectorOps.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineVectorOps.cpp b/lib/Transforms/InstCombine/InstCombineVectorOps.cpp index d43093d..f3de6e2 100644 --- a/lib/Transforms/InstCombine/InstCombineVectorOps.cpp +++ b/lib/Transforms/InstCombine/InstCombineVectorOps.cpp @@ -732,7 +732,9 @@ InstCombiner::EvaluateInDifferentElementOrder(Value *V, ArrayRef<int> Mask) { } if (!Found) - return UndefValue::get(I->getType()); + return UndefValue::get( + VectorType::get(V->getType()->getScalarType(), Mask.size())); + Value *V = EvaluateInDifferentElementOrder(I->getOperand(0), Mask); return InsertElementInst::Create(V, I->getOperand(1), Builder->getInt32(Index), "", I); |