[llvm] de03e10 - [DirectX] Change placeholders from `undef` to `poison` used in fully instantiated vector [NFC] (#130970)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Mar 16 02:47:51 PDT 2025
Author: Pedro Lobo
Date: 2025-03-16T09:47:48Z
New Revision: de03e102d1ea4da1c62b9ad735848d8869d08b44
URL: https://github.com/llvm/llvm-project/commit/de03e102d1ea4da1c62b9ad735848d8869d08b44
DIFF: https://github.com/llvm/llvm-project/commit/de03e102d1ea4da1c62b9ad735848d8869d08b44.diff
LOG: [DirectX] Change placeholders from `undef` to `poison` used in fully instantiated vector [NFC] (#130970)
Added:
Modified:
llvm/lib/Target/DirectX/DXILIntrinsicExpansion.cpp
llvm/lib/Target/DirectX/DXILOpLowering.cpp
llvm/test/CodeGen/DirectX/BufferLoad.ll
llvm/test/CodeGen/DirectX/RawBufferLoad.ll
llvm/test/CodeGen/DirectX/cross.ll
Removed:
################################################################################
diff --git a/llvm/lib/Target/DirectX/DXILIntrinsicExpansion.cpp b/llvm/lib/Target/DirectX/DXILIntrinsicExpansion.cpp
index cf142806bb1df..e44d3b70eb657 100644
--- a/llvm/lib/Target/DirectX/DXILIntrinsicExpansion.cpp
+++ b/llvm/lib/Target/DirectX/DXILIntrinsicExpansion.cpp
@@ -147,7 +147,7 @@ static Value *expandCrossIntrinsic(CallInst *Orig) {
Value *zx_xz = MulSub(op0_z, op0_x, op1_z, op1_x);
Value *xy_yx = MulSub(op0_x, op0_y, op1_x, op1_y);
- Value *cross = UndefValue::get(VT);
+ Value *cross = PoisonValue::get(VT);
cross = Builder.CreateInsertElement(cross, yz_zy, (uint64_t)0);
cross = Builder.CreateInsertElement(cross, zx_xz, 1);
cross = Builder.CreateInsertElement(cross, xy_yx, 2);
diff --git a/llvm/lib/Target/DirectX/DXILOpLowering.cpp b/llvm/lib/Target/DirectX/DXILOpLowering.cpp
index d5a797fde6381..dff9f3e03079e 100644
--- a/llvm/lib/Target/DirectX/DXILOpLowering.cpp
+++ b/llvm/lib/Target/DirectX/DXILOpLowering.cpp
@@ -482,7 +482,7 @@ class OpLowerer {
if (!Extracts[I])
Extracts[I] = IRB.CreateExtractValue(Op, I);
- Value *Vec = UndefValue::get(OldTy);
+ Value *Vec = PoisonValue::get(OldTy);
for (int I = 0, E = N; I != E; ++I)
Vec = IRB.CreateInsertElement(Vec, Extracts[I], I);
OldResult->replaceAllUsesWith(Vec);
diff --git a/llvm/test/CodeGen/DirectX/BufferLoad.ll b/llvm/test/CodeGen/DirectX/BufferLoad.ll
index 3619f0aa63c5b..6d5146a9026ce 100644
--- a/llvm/test/CodeGen/DirectX/BufferLoad.ll
+++ b/llvm/test/CodeGen/DirectX/BufferLoad.ll
@@ -43,7 +43,7 @@ define void @loadv4f32() {
; CHECK: extractvalue %dx.types.ResRet.f32 [[DATA4]], 1
; CHECK: extractvalue %dx.types.ResRet.f32 [[DATA4]], 2
; CHECK: extractvalue %dx.types.ResRet.f32 [[DATA4]], 3
- ; CHECK: insertelement <4 x float> undef
+ ; CHECK: insertelement <4 x float> poison
; CHECK: insertelement <4 x float>
; CHECK: insertelement <4 x float>
; CHECK: insertelement <4 x float>
diff --git a/llvm/test/CodeGen/DirectX/RawBufferLoad.ll b/llvm/test/CodeGen/DirectX/RawBufferLoad.ll
index 586b9c44e95d2..a79392433de5d 100644
--- a/llvm/test/CodeGen/DirectX/RawBufferLoad.ll
+++ b/llvm/test/CodeGen/DirectX/RawBufferLoad.ll
@@ -69,7 +69,7 @@ define void @loadv4f32_struct(i32 %index) {
; CHECK: extractvalue %dx.types.ResRet.f32 [[DATA]], 1
; CHECK: extractvalue %dx.types.ResRet.f32 [[DATA]], 2
; CHECK: extractvalue %dx.types.ResRet.f32 [[DATA]], 3
- ; CHECK: insertelement <4 x float> undef
+ ; CHECK: insertelement <4 x float> poison
; CHECK: insertelement <4 x float>
; CHECK: insertelement <4 x float>
; CHECK: insertelement <4 x float>
@@ -97,7 +97,7 @@ define void @loadv4f32_byte(i32 %offset) {
; CHECK: extractvalue %dx.types.ResRet.f32 [[DATA]], 1
; CHECK: extractvalue %dx.types.ResRet.f32 [[DATA]], 2
; CHECK: extractvalue %dx.types.ResRet.f32 [[DATA]], 3
- ; CHECK: insertelement <4 x float> undef
+ ; CHECK: insertelement <4 x float> poison
; CHECK: insertelement <4 x float>
; CHECK: insertelement <4 x float>
; CHECK: insertelement <4 x float>
@@ -125,7 +125,7 @@ define void @loadelements(i32 %index) {
; CHECK: extractvalue %dx.types.ResRet.f32 [[DATAF32]], 1
; CHECK: extractvalue %dx.types.ResRet.f32 [[DATAF32]], 2
; CHECK: extractvalue %dx.types.ResRet.f32 [[DATAF32]], 3
- ; CHECK: insertelement <4 x float> undef
+ ; CHECK: insertelement <4 x float> poison
; CHECK: insertelement <4 x float>
; CHECK: insertelement <4 x float>
; CHECK: insertelement <4 x float>
@@ -144,7 +144,7 @@ define void @loadelements(i32 %index) {
; CHECK: extractvalue %dx.types.ResRet.i32 [[DATAI32]], 1
; CHECK: extractvalue %dx.types.ResRet.i32 [[DATAI32]], 2
; CHECK: extractvalue %dx.types.ResRet.i32 [[DATAI32]], 3
- ; CHECK: insertelement <4 x i32> undef
+ ; CHECK: insertelement <4 x i32> poison
; CHECK: insertelement <4 x i32>
; CHECK: insertelement <4 x i32>
; CHECK: insertelement <4 x i32>
@@ -180,7 +180,7 @@ define void @loadnested(i32 %index) {
; CHECK: extractvalue %dx.types.ResRet.f32 [[DATAF32]], 1
; CHECK: extractvalue %dx.types.ResRet.f32 [[DATAF32]], 2
; CHECK: extractvalue %dx.types.ResRet.f32 [[DATAF32]], 3
- ; CHECK: insertelement <4 x float> undef
+ ; CHECK: insertelement <4 x float> poison
; CHECK: insertelement <4 x float>
; CHECK: insertelement <4 x float>
; CHECK: insertelement <4 x float>
@@ -196,7 +196,7 @@ define void @loadnested(i32 %index) {
; CHECK: extractvalue %dx.types.ResRet.f16 [[DATAF16]], 0
; CHECK: extractvalue %dx.types.ResRet.f16 [[DATAF16]], 1
; CHECK: extractvalue %dx.types.ResRet.f16 [[DATAF16]], 2
- ; CHECK: insertelement <3 x half> undef
+ ; CHECK: insertelement <3 x half> poison
; CHECK: insertelement <3 x half>
; CHECK: insertelement <3 x half>
; CHECK: call void @v3f16_user(<3 x half>
@@ -221,7 +221,7 @@ define void @loadv4f64_byte(i32 %offset) {
; CHECK: extractvalue %dx.types.ResRet.f64 [[DATA]], 1
; CHECK: extractvalue %dx.types.ResRet.f64 [[DATA]], 2
; CHECK: extractvalue %dx.types.ResRet.f64 [[DATA]], 3
- ; CHECK: insertelement <4 x double> undef
+ ; CHECK: insertelement <4 x double> poison
; CHECK: insertelement <4 x double>
; CHECK: insertelement <4 x double>
; CHECK: insertelement <4 x double>
diff --git a/llvm/test/CodeGen/DirectX/cross.ll b/llvm/test/CodeGen/DirectX/cross.ll
index 6ec3ec4d3594a..e787c5035925b 100644
--- a/llvm/test/CodeGen/DirectX/cross.ll
+++ b/llvm/test/CodeGen/DirectX/cross.ll
@@ -22,7 +22,7 @@ entry:
; CHECK: %4 = fmul half %x0, %y1
; CHECK: %5 = fmul half %x1, %y0
; CHECK: %hlsl.cross3 = fsub half %4, %5
- ; CHECK: %6 = insertelement <3 x half> undef, half %hlsl.cross1, i64 0
+ ; CHECK: %6 = insertelement <3 x half> poison, half %hlsl.cross1, i64 0
; CHECK: %7 = insertelement <3 x half> %6, half %hlsl.cross2, i64 1
; CHECK: %8 = insertelement <3 x half> %7, half %hlsl.cross3, i64 2
; CHECK: ret <3 x half> %8
@@ -47,7 +47,7 @@ entry:
; CHECK: %4 = fmul float %x0, %y1
; CHECK: %5 = fmul float %x1, %y0
; CHECK: %hlsl.cross3 = fsub float %4, %5
- ; CHECK: %6 = insertelement <3 x float> undef, float %hlsl.cross1, i64 0
+ ; CHECK: %6 = insertelement <3 x float> poison, float %hlsl.cross1, i64 0
; CHECK: %7 = insertelement <3 x float> %6, float %hlsl.cross2, i64 1
; CHECK: %8 = insertelement <3 x float> %7, float %hlsl.cross3, i64 2
; CHECK: ret <3 x float> %8
More information about the llvm-commits
mailing list