This is used on an extract vector element index which is most cases is going to be an i32 or i64 and the element will be a valid element number. But it is possible to construct IR with a larger type and large out of range value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337652
91177308-0d34-0410-b5e6-
96231b3b80d8
return false;
const ConstantInt *Val = dyn_cast<ConstantInt>(U->getOperand(1));
- if (!Val || Val->getZExtValue() != 0)
+ if (!Val || !Val->isZero())
return false;
ReduxExtracted = true;