This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Small correction in SITargetLowering::performOrCombine()
ClosedPublic

Authored by kpyzhov on Nov 4 2021, 10:09 AM.

Details

Summary

Using the "LHS" variable in the splitBinaryBitConstantOp() call is not valid since "LHS" and "RHS" may be swapped earlier in the code.

Diff Detail

Event Timeline

kpyzhov created this revision.Nov 4 2021, 10:09 AM
kpyzhov requested review of this revision.Nov 4 2021, 10:09 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 4 2021, 10:09 AM
foad added a comment.Nov 4 2021, 10:15 AM

Needs a test.

Agreed on needing a lit test

kpyzhov updated this revision to Diff 385086.Nov 5 2021, 8:29 AM
kzhuravl accepted this revision.Nov 10 2021, 11:52 AM

LGTM with a nit below. Thanks!

llvm/test/CodeGen/AMDGPU/combine-reg-or-const.ll
2

Can you auto generate this test before submitting?

This revision is now accepted and ready to land.Nov 10 2021, 11:52 AM
kzhuravl added inline comments.Nov 10 2021, 1:19 PM
llvm/test/CodeGen/AMDGPU/combine-reg-or-const.ll
2

Alternatively, you can add more checks for more context, thanks.

This revision was landed with ongoing or failed builds.Nov 10 2021, 6:07 PM
This revision was automatically updated to reflect the committed changes.