This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Fix inline asm causing assert during PreRARematerialize stage in scheduler pass
ClosedPublic

Authored by vangthao on Apr 7 2022, 5:51 PM.

Diff Detail

Event Timeline

vangthao created this revision.Apr 7 2022, 5:51 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 7 2022, 5:51 PM
vangthao requested review of this revision.Apr 7 2022, 5:51 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 7 2022, 5:51 PM
arsenm added inline comments.Apr 7 2022, 6:24 PM
llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp
742–743

Null dereference before null check

foad added inline comments.Apr 8 2022, 2:15 AM
llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp
742–743

getOneDef already returns a specific operand, so it seems odd to ignore this and look at operand 0 of the same instruction instead. Maybe check getOperandNo() == 0 instead if that's what you want?

743

How could Def ever be null here?

vangthao updated this revision to Diff 421536.Apr 8 2022, 8:26 AM

Remove redundant null check and use MachineOperand from getOneDef.

vangthao added inline comments.Apr 8 2022, 8:27 AM
llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp
742–743

You're right, thanks for catching this!

foad accepted this revision.Apr 8 2022, 8:40 AM

LGTM.

This revision is now accepted and ready to land.Apr 8 2022, 8:40 AM
This revision was landed with ongoing or failed builds.Apr 8 2022, 9:24 AM
This revision was automatically updated to reflect the committed changes.