================
@@ -1476,8 +1486,14 @@ CoerceScalableToFixed(CodeGenFunction &CGF,
llvm::FixedVectorType *ToTy,
// If we are casting a scalable i1 predicate vector to a fixed i8
// vector, first bitcast the source.
if (FromTy->getElementType()->isIntegerTy(1) &&
- FromTy->getElementCount().isKnownMultipleOf(8) &&
ToTy->getElementType() == CGF.Builder.getInt8Ty()) {
+ if (!FromTy->getElementCount().isKnownMultipleOf(8)) {
+ FromTy = llvm::ScalableVectorType::get(
+ FromTy->getElementType(),
+ llvm::alignTo<8>(FromTy->getElementCount().getKnownMinValue()));
+ llvm::Value *ZeroVec = llvm::Constant::getNullValue(FromTy);
----------------
nunoplopes wrote:
Yes, that's the semantics. A single poison bits taints the whole value.
So when you bitcast a vector to elements with different sizes, you need to
account for the lanes that share the original lane.
In summary, you can't combine poison elements into a lane that is meaningful
for you.
https://github.com/llvm/llvm-project/pull/139190
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits