llvm-project
79435de8 - [ConstantFold] Support scalable constant splats in ConstantFoldCastInstruction (#133207)

Commit
255 days ago
[ConstantFold] Support scalable constant splats in ConstantFoldCastInstruction (#133207) Previously only fixed vector splats were handled. This adds supports for scalable vectors too by allowing ConstantExpr splats. We need to add the extra V->getType()->isVectorTy() check because a ConstantExpr might be a scalar to vector bitcast. By allowing ConstantExprs this also allow fixed vector ConstantExprs to be folded, which causes the diffs in llvm/test/Analysis/ValueTracking/known-bits-from-operator-constexpr.ll and llvm/test/Transforms/InstSimplify/ConstProp/cast-vector.ll. I can remove them from this PR if reviewers would prefer. Fixes #132922
Author
Parents
Loading