================
@@ -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
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to