diff options
| author | Sanjay Patel <spatel@rotateright.com> | 2018-07-10 14:27:55 +0000 |
|---|---|---|
| committer | Sanjay Patel <spatel@rotateright.com> | 2018-07-10 14:27:55 +0000 |
| commit | 3333106a6248635accab6d5b8c2f737ba5d06e6d (patch) | |
| tree | 1bc4f8cae8daf5b6f5ade261db55e872c209281c /llvm/lib/Transforms | |
| parent | 2827420aabb355b84eefc53f7a3d405c1696deeb (diff) | |
| download | bcm5719-llvm-3333106a6248635accab6d5b8c2f737ba5d06e6d.tar.gz bcm5719-llvm-3333106a6248635accab6d5b8c2f737ba5d06e6d.zip | |
[InstCombine] drop poison flags when shuffle mask undef propagates to constant
llvm-svn: 336679
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp index 16b057cb0e5..f317252a00d 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp @@ -1223,6 +1223,11 @@ static Instruction *foldSelectShuffleWith1Binop(ShuffleVectorInst &Shuf) { // shuf X, (bop X, C), M --> bop X, C' Instruction *NewBO = BinaryOperator::Create(BOpcode, X, NewC); NewBO->copyIRFlags(BO); + + // An undef shuffle mask element may propagate as an undef constant element in + // the new binop. That would produce poison where the original code might not. + if (Mask->containsUndefElement()) + NewBO->dropPoisonGeneratingFlags(); return NewBO; } |

