[llvm] [DirectX] Make dx.RawBuffer an op that can't be replaced (PR #154620)
Farzon Lotfi via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 26 07:50:13 PDT 2025
================
@@ -0,0 +1,143 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
+; RUN: opt -S -dxil-resource-type -dxil-resource-access -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s
+
+%__cblayout_d = type <{ i32, i32, i32, i32 }>
+
+ at .str = internal unnamed_addr constant [2 x i8] c"a\00", align 1
+ at d.cb = local_unnamed_addr global target("dx.CBuffer", target("dx.Layout", %__cblayout_d, 16, 0, 4, 8, 12)) poison
+ at e = external hidden local_unnamed_addr addrspace(2) global i32, align 4
+ at d.str = internal unnamed_addr constant [2 x i8] c"d\00", align 1
+
+define void @CSMain() local_unnamed_addr {
+; CHECK-LABEL: define void @CSMain() local_unnamed_addr {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: [[D_CB_H_I_I:%.*]] = tail call target("dx.CBuffer", target("dx.Layout", [[__CBLAYOUT_D:%.*]], 16, 0, 4, 8, 12)) @llvm.dx.resource.handlefromimplicitbinding.tdx.CBuffer_tdx.Layout_s___cblayout_ds_16_0_4_8_12tt(i32 3, i32 0, i32 1, i32 0, i1 false, ptr nonnull @d.str)
+; CHECK-NEXT: store target("dx.CBuffer", target("dx.Layout", [[__CBLAYOUT_D]], 16, 0, 4, 8, 12)) [[D_CB_H_I_I]], ptr @d.cb, align 4
----------------
farzonl wrote:
So the problem I have with these suggestions is I used `update_test_checks.py` to generate these checks and anything I rename will just get changed back the next time I run the script. So not sure how to address your concerns.
https://github.com/llvm/llvm-project/pull/154620
More information about the llvm-commits
mailing list