This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU/GlobalISel: Fix crash on wide constant load with VGPR pointer
ClosedPublic

Authored by arsenm on Oct 7 2019, 3:07 PM.

Details

Summary

This was ignoring the register bank of the input pointer, and
isUniformMMO seems overly aggressive.

This will now conservatively assume a VGPR in cases where the incoming
bank hasn't been determined yet (i.e. is from a loop phi).

Diff Detail

Event Timeline

arsenm created this revision.Oct 7 2019, 3:07 PM
nhaehnle added inline comments.Oct 8 2019, 8:24 AM
test/CodeGen/AMDGPU/GlobalISel/legalize-extract.mir
1118–1131 ↗(On Diff #223669)

This change seems unrelated.

arsenm updated this revision to Diff 223895.Oct 8 2019, 10:07 AM

Fix wrong test

nhaehnle accepted this revision.Oct 9 2019, 3:47 AM

I do have one question. Apart from that it LGTM.

lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp
326–327

You mean because isUniformMMO returns true if the MMO doesn't have a pointer? There's a comment in that function which justifies that (though I'm not sure whether that comment is correct).

This revision is now accepted and ready to land.Oct 9 2019, 3:47 AM
arsenm marked an inline comment as done.Oct 9 2019, 2:53 PM
arsenm added inline comments.
lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp
326–327

The comment there isn't entirely wrong, but also isn't entirely correct. There can also be null without a PSV. I don't think this would ever happen in a real program, and is more a MIR semantics question.

arsenm closed this revision.Oct 9 2019, 3:43 PM

r374255