This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Fix an out of date assert in addressing FrameIndex
ClosedPublic

Authored by cfang on Sep 13 2019, 3:01 PM.

Details

Summary

Should use StachPtrOffsetReg instead of FrameOffsetReg to address FrameIndex.

Diff Detail

Repository
rL LLVM

Event Timeline

cfang created this revision.Sep 13 2019, 3:01 PM
arsenm added inline comments.Sep 19 2019, 5:01 PM
test/CodeGen/AMDGPU/stack-pointer-offset-relative-frameindex.ll
5 ↗(On Diff #220176)

You should be able to reduce this. You don't need all of these types defined

24 ↗(On Diff #220176)

This isn't a useful check

cfang marked 4 inline comments as done.Sep 24 2019, 3:42 PM
cfang added inline comments.
test/CodeGen/AMDGPU/stack-pointer-offset-relative-frameindex.ll
5 ↗(On Diff #220176)

But if I replace these defined types of struct with type of float or int for example, I can not reproduce the assert.

24 ↗(On Diff #220176)

What do you expect to check for a case of assert? I just wanted to avoid irrelevant checks.

arsenm added inline comments.Sep 24 2019, 9:14 PM
test/CodeGen/AMDGPU/stack-pointer-offset-relative-frameindex.ll
5 ↗(On Diff #220176)

You can always avoid the struct types. You may also switch to a MIR test

24 ↗(On Diff #220176)

You can check the stack accesses or generate the checks

cfang updated this revision to Diff 222017.Sep 26 2019, 1:12 PM
cfang marked 2 inline comments as done.
  1. Remove the use of structs to simplify the test
  2. generate llc checks with utils/update_llc_test_checks.py
arsenm added inline comments.Sep 30 2019, 12:48 PM
test/CodeGen/AMDGPU/stack-pointer-offset-relative-frameindex.ll
45 ↗(On Diff #222017)

Probably should make this defined

57 ↗(On Diff #222017)

Probably should not use unreachable

cfang updated this revision to Diff 222488.Sep 30 2019, 1:37 PM

update the test based on the comment:

  1. use a defined comparison
  2. remove "unreachable", and make it branch to exit.
cfang marked 2 inline comments as done.Sep 30 2019, 1:38 PM
arsenm accepted this revision.Oct 1 2019, 3:38 PM

LGTM

This revision is now accepted and ready to land.Oct 1 2019, 3:38 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptOct 1 2019, 4:05 PM