Skip to content

Commit ccf2109

Browse files
authored
[Metadata] Change placeholder from undef to poison (#131469)
Replace `undef` constant metadata uses with `poison`.
1 parent 5b90065 commit ccf2109

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

clang/lib/CodeGen/CodeGenFunction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ void CodeGenFunction::EmitKernelMetadata(const FunctionDecl *FD,
640640
HintQTy->isSignedIntegerType() ||
641641
(HintEltQTy && HintEltQTy->getElementType()->isSignedIntegerType());
642642
llvm::Metadata *AttrMDArgs[] = {
643-
llvm::ConstantAsMetadata::get(llvm::UndefValue::get(
643+
llvm::ConstantAsMetadata::get(llvm::PoisonValue::get(
644644
CGM.getTypes().ConvertType(A->getTypeHint()))),
645645
llvm::ConstantAsMetadata::get(llvm::ConstantInt::get(
646646
llvm::IntegerType::get(Context, 32),

clang/test/CodeGenCUDASPIRV/spirv-attrs.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ __global__ void intel_reqd_sub_group_size_64() {}
3030
// CHECK: ![[WG_SIZE_ZEROS]] = !{i32 0, i32 0, i32 0}
3131
// CHECK: ![[WG_SIZE]] = !{i32 128, i32 1, i32 1}
3232
// CHECK: ![[WG_HINT]] = !{i32 2, i32 2, i32 2}
33-
// CHECK: ![[VEC_HINT]] = !{i32 undef, i32 1}
33+
// CHECK: ![[VEC_HINT]] = !{i32 poison, i32 1}
3434
// CHECK: ![[SUB_GRP]] = !{i32 64}

clang/test/CodeGenOpenCL/kernel-attributes.cl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ kernel __attribute__((vec_type_hint(uint4))) __attribute__((work_group_size_hint
1111
kernel __attribute__((intel_reqd_sub_group_size(8))) void kernel3(int a) {}
1212
// CHECK: define {{(dso_local )?}}spir_kernel void @kernel3(i32 {{[^%]*}}%a) {{[^{]+}} !intel_reqd_sub_group_size ![[MD5:[0-9]+]]
1313

14-
// CHECK: [[MD1]] = !{i32 undef, i32 1}
14+
// CHECK: [[MD1]] = !{i32 poison, i32 1}
1515
// CHECK: [[MD2]] = !{i32 1, i32 2, i32 4}
16-
// CHECK: [[MD3]] = !{<4 x i32> undef, i32 0}
16+
// CHECK: [[MD3]] = !{<4 x i32> poison, i32 0}
1717
// CHECK: [[MD4]] = !{i32 8, i32 16, i32 32}
1818
// CHECK: [[MD5]] = !{i32 8}

0 commit comments

Comments
 (0)