]> granicus.if.org Git - llvm/commit
[InstCombine] Fix a vector splat handling bug in transformZExtICmp.
authorCraig Topper <craig.topper@intel.com>
Thu, 5 Oct 2017 07:59:11 +0000 (07:59 +0000)
committerCraig Topper <craig.topper@intel.com>
Thu, 5 Oct 2017 07:59:11 +0000 (07:59 +0000)
commit8114ee377bf83ebf5d90174a4ba8b2434b782d74
tree4776d243086dbb326be42337ca3925c8b842450c
parent17f5bd1520b692ca0a68153684de466b9c66e172
[InstCombine] Fix a vector splat handling bug in transformZExtICmp.

We were using an i1 type and then zero extending to a vector. Instead just create the 0/1 directly as a ConstantInt with the correct type. No need to ask ConstantExpr to zero extend for us.

This bug is a bit tricky to hit because it requires us to visit a zext of an icmp that would normally be simplified to true/false, but that icmp hasnt' been visited yet. In the test case this zext and icmp were created by visiting a udiv and due to worklist ordering we got to the zext first.

Fixes PR34841.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314971 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineCasts.cpp
test/Transforms/InstCombine/div.ll