Skip to content

Commit 2dd292d

Browse files
committed
[DirectX] Change placeholders from undef to poison
Call `insertelement` with a `poison` vector.
1 parent 89fa592 commit 2dd292d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

llvm/lib/Target/DirectX/DXILIntrinsicExpansion.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ static Value *expandCrossIntrinsic(CallInst *Orig) {
147147
Value *zx_xz = MulSub(op0_z, op0_x, op1_z, op1_x);
148148
Value *xy_yx = MulSub(op0_x, op0_y, op1_x, op1_y);
149149

150-
Value *cross = UndefValue::get(VT);
150+
Value *cross = PoisonValue::get(VT);
151151
cross = Builder.CreateInsertElement(cross, yz_zy, (uint64_t)0);
152152
cross = Builder.CreateInsertElement(cross, zx_xz, 1);
153153
cross = Builder.CreateInsertElement(cross, xy_yx, 2);

llvm/lib/Target/DirectX/DXILOpLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ class OpLowerer {
483483
if (!Extracts[I])
484484
Extracts[I] = IRB.CreateExtractValue(Op, I);
485485

486-
Value *Vec = UndefValue::get(OldTy);
486+
Value *Vec = PoisonValue::get(OldTy);
487487
for (int I = 0, E = N; I != E; ++I)
488488
Vec = IRB.CreateInsertElement(Vec, Extracts[I], I);
489489
OldResult->replaceAllUsesWith(Vec);

0 commit comments

Comments
 (0)