[llvm] [CVP][LVI] Add support for vectors (PR #97428)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 3 00:39:23 PDT 2024
================
@@ -844,6 +862,9 @@ static ConstantRange toConstantRange(const ValueLatticeElement &Val,
unsigned BW = Ty->getScalarSizeInBits();
if (Val.isUnknown())
return ConstantRange::getEmpty(BW);
+ if (Val.isConstant())
+ if (auto *VTy = dyn_cast<FixedVectorType>(Ty))
+ return getConstantRangeFromVector(Val.getConstant(), VTy);
----------------
goldsteinn wrote:
What about just using `computeConstantRange` to do it?
AFAICT the only case they handle differently is `poison` elements.
https://github.com/llvm/llvm-project/pull/97428
More information about the llvm-commits
mailing list