aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CGCall.cpp
diff options
context:
space:
mode:
authorPedro Lobo <pedro.lobo@tecnico.ulisboa.pt>2024-12-02 09:00:39 +0000
committerGitHub <noreply@github.com>2024-12-02 09:00:39 +0000
commit98e747ba56b2f8b51a7c797a3f379d02c545c42b (patch)
tree6011325977964ae8cf7797f85f319914450688f7 /clang/lib/CodeGen/CGCall.cpp
parent4851dbb8d6f1c00ad382ff4780293ca9a743c609 (diff)
downloadllvm-98e747ba56b2f8b51a7c797a3f379d02c545c42b.zip
llvm-98e747ba56b2f8b51a7c797a3f379d02c545c42b.tar.gz
llvm-98e747ba56b2f8b51a7c797a3f379d02c545c42b.tar.bz2
[clang] Use poison instead of undef as the placeholder when creating a new vector [NFC] (#117064)
Call `@llvm.vector.insert` with a `poison` vector when coercing a fixed vector to a scalable vector with the same element type.
Diffstat (limited to 'clang/lib/CodeGen/CGCall.cpp')
-rw-r--r--clang/lib/CodeGen/CGCall.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index 20455db..28a5526 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/lib/CodeGen/CGCall.cpp
@@ -1314,10 +1314,10 @@ static llvm::Value *CreateCoercedLoad(Address Src, llvm::Type *Ty,
}
if (ScalableDstTy->getElementType() == FixedSrcTy->getElementType()) {
auto *Load = CGF.Builder.CreateLoad(Src);
- auto *UndefVec = llvm::UndefValue::get(ScalableDstTy);
+ auto *PoisonVec = llvm::PoisonValue::get(ScalableDstTy);
auto *Zero = llvm::Constant::getNullValue(CGF.CGM.Int64Ty);
llvm::Value *Result = CGF.Builder.CreateInsertVector(
- ScalableDstTy, UndefVec, Load, Zero, "cast.scalable");
+ ScalableDstTy, PoisonVec, Load, Zero, "cast.scalable");
if (ScalableDstTy != Ty)
Result = CGF.Builder.CreateBitCast(Result, Ty);
return Result;