Do not iterate on scalable vector. Also do not return constant scalable vector
from ConstantInt::get().
Fix result type by using getElementCount() instead of getNumElements().
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
current upstream crash at : llvm/lib/IR/Value.cpp:404: void llvm::Value::doRAUW(llvm::Value *, llvm::Value::ReplaceMetadataUses): Assertion `New->getType() == getType() && "replaceAllUses of value with new value of different type!"' failed.
take test.ll
define <vscale x 4 x i1> @icmp_undef() { %r = icmp eq <vscale x 4 x i32> undef, undef ret <vscale x 4 x i1> %r }
run : ./bin/opt -S -constprop t.ll -o -
Comment Actions
We should fix ConstantInt::get and Constant::getAllOnesValue to work with scalable types; it doesn't make sense to avoid them given we can generate an appropriate constant (splat using insertelement/shufflevector).
Comment Actions
Thanks Eli for the feedback!
Supporting scalable vector for ConstantInt::get() and Constant::getAllOnesValue() in D74386