OSDN Git Service

[InstCombine] Fix a crash in getSelectCondition if we happen to have two inverse...
authorCraig Topper <craig.topper@intel.com>
Thu, 10 Aug 2017 17:48:14 +0000 (17:48 +0000)
committerCraig Topper <craig.topper@intel.com>
Thu, 10 Aug 2017 17:48:14 +0000 (17:48 +0000)
commitc2658cfc74924899e8cc186de123110873161daa
tree2e922cdafb6d5955efbcfce017dd1142233806d8
parent992d9d34736cceb4cd327e57886d82b41bae85d2
[InstCombine] Fix a crash in getSelectCondition if we happen to have two inverse vectors of i1 constants.

We used to try to truncate the constant vector to vXi1, but if it's already i1 this would fail. Instead we now use IRBuilder::getZExtOrTrunc which should check the type and only create a trunc if needed. I believe this should trigger constant folding in the IRBuilder and ultimately do the same thing just with the additional type check.

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