This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Fix reporting of incorrect commutable operand indices
ClosedPublic

Authored by frasercrmck on Aug 17 2021, 7:34 AM.

Details

Summary

This patch fixes an issue where RISCV's findCommutedOpIndices would
incorrectly return the pseudo CommuteAnyOperandIndex as a commutable
operand index, rather than fixing a specific index.

Diff Detail

Event Timeline

frasercrmck created this revision.Aug 17 2021, 7:34 AM
frasercrmck requested review of this revision.Aug 17 2021, 7:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 17 2021, 7:34 AM
rogfer01 accepted this revision.Aug 19 2021, 12:22 AM

I'm not super familiar with this mechanism. But reading the docs I think this is correct.

Also, strictly logically, that else if was trivially true (due to an earlier assignment) which was not probably the intent of the code.

Good catch @frasercrmck!

This revision is now accepted and ready to land.Aug 19 2021, 12:22 AM
This revision was landed with ongoing or failed builds.Aug 20 2021, 2:37 AM
This revision was automatically updated to reflect the committed changes.

@frasercrmck should we backport this to llvm 13?

@frasercrmck should we backport this to llvm 13?

Hey, sorry, I was on holiday and should have been more proactive about this before I left. I see you've taken this on in 51593 - thanks!