[PATCH] D48979: AMDGPU: Fix UBSan error caused by r335942

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 5 10:42:27 PDT 2018


arsenm added inline comments.


================
Comment at: lib/Target/AMDGPU/AMDGPUISelLowering.cpp:3942-3944
   const AMDGPUMachineFunction *MFI = MF.getInfo<AMDGPUMachineFunction>();
-  const AMDGPUSubtarget &ST = MF.getSubtarget<AMDGPUSubtarget>();
-  unsigned ExplicitArgOffset = ST.getExplicitKernelArgOffset(MF.getFunction());
+  const AMDGPUCommonSubtarget &ST =
+      AMDGPUCommonSubtarget::get(getTargetMachine(), MF.getFunction());
----------------
tstellar wrote:
> arsenm wrote:
> > Why can't this keep getting the offset from the subtarget?
> That would require moving another function (isAMDCodeObjectV2) into the AMDGPUCommonSubtarget class.  I've been trying not to add more things to this class, but I can make this change.
This ABI stuff probably does need to move there, but my main concern is how this broke so subtly


Repository:
  rL LLVM

https://reviews.llvm.org/D48979





More information about the llvm-commits mailing list