[llvm-branch-commits] [llvm] [AMDGPU] Fold constant offsets into named barrier addresses (PR #205216)
Jay Foad via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Jun 23 02:20:00 PDT 2026
================
@@ -1551,7 +1551,11 @@ SDValue AMDGPUTargetLowering::LowerGlobalAddress(AMDGPUMachineFunctionInfo *MFI,
unsigned BarCnt = cast<GlobalVariable>(GV)->getGlobalSize(DL) / 16;
MFI->recordNumNamedBarriers(Address.value(), BarCnt);
}
- return DAG.getConstant(*Address, SDLoc(Op), Op.getValueType());
+ assert((G->getOffset() == 0 ||
+ (IsNamedBarrier && G->getOffset() % 16 == 0)) &&
+ "named barrier offset must land on a barrier object");
----------------
jayfoad wrote:
Isn't this going to crash the compiler if you write a test case with a gep that does not follow this rule? That's not acceptable.
https://github.com/llvm/llvm-project/pull/205216
More information about the llvm-branch-commits
mailing list