[llvm-branch-commits] [clang] [HLSL] Introduce address space `hlsl_constant(2)` for constant buffer declarations (PR #123411)
Helena Kotas via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Fri Jan 17 14:14:31 PST 2025
================
@@ -100,22 +100,6 @@ GlobalVariable *replaceBuffer(CGHLSLRuntime::Buffer &Buf) {
llvm::formatv("{0}{1}", Buf.Name, Buf.IsCBuffer ? ".cb." : ".tb."),
GlobalValue::NotThreadLocal);
- IRBuilder<> B(CBGV->getContext());
- Value *ZeroIdx = B.getInt32(0);
- // Replace Const use with CB use.
- for (auto &[GV, Offset] : Buf.Constants) {
- Value *GEP =
- B.CreateGEP(Buf.LayoutStruct, CBGV, {ZeroIdx, B.getInt32(Offset)});
-
- assert(Buf.LayoutStruct->getElementType(Offset) == GV->getValueType() &&
- "constant type mismatch");
-
- // Replace.
- GV->replaceAllUsesWith(GEP);
- // Erase GV.
- GV->removeDeadConstantUsers();
- GV->eraseFromParent();
- }
----------------
hekota wrote:
I am removing this part to make sure we preserve the loads in the new address space, but there is more reworking to be done in this area.
https://github.com/llvm/llvm-project/pull/123411
More information about the llvm-branch-commits
mailing list