This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Fix UBSan error caused by r335942
ClosedPublic

Authored by tstellar on Jul 5 2018, 10:20 AM.

Diff Detail

Event Timeline

tstellar created this revision.Jul 5 2018, 10:20 AM
arsenm added inline comments.Jul 5 2018, 10:24 AM
lib/Target/AMDGPU/AMDGPUISelLowering.cpp
3942–3944

Why can't this keep getting the offset from the subtarget?

lib/Target/AMDGPU/AMDGPUISelLowering.h
297–298

Weird formatting

tstellar added inline comments.Jul 5 2018, 10:30 AM
lib/Target/AMDGPU/AMDGPUISelLowering.cpp
3942–3944

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.

arsenm added inline comments.Jul 5 2018, 10:42 AM
lib/Target/AMDGPU/AMDGPUISelLowering.cpp
3942–3944

This ABI stuff probably does need to move there, but my main concern is how this broke so subtly

tstellar updated this revision to Diff 154269.Jul 5 2018, 11:11 AM

Use subtarget query to get kernel arg offset.

tstellar added inline comments.Jul 5 2018, 11:12 AM
lib/Target/AMDGPU/AMDGPUISelLowering.cpp
3942–3944

AMDGPUSubtarget is now GCN specific, so I just forgot to rename AMDGPUSubtarget->AMDGPUCommonSubtarget.

I have a few cleanups to do after splitting the targets and making the subtarget names make sense is one of them.

dstenb resigned from this revision.Jul 6 2018, 6:38 AM

I don't really know anything about the AMDGPU target, so I'll resign as reviewer to make that clear, but thanks for notifying me about the fix!

arsenm accepted this revision.Jul 6 2018, 6:41 AM

LGTM

This revision is now accepted and ready to land.Jul 6 2018, 6:41 AM
This revision was automatically updated to reflect the committed changes.