This is an archive of the discontinued LLVM Phabricator instance.

[RISCVGatherScatterLowering] Remove restriction that shift must have constant operand
ClosedPublic

Authored by reames on May 12 2023, 11:33 AM.

Details

Summary

This has been present from the original patch, and doesn't appear to be strongly justified. We do need to be careful of commutativity.

Diff Detail

Event Timeline

reames created this revision.May 12 2023, 11:33 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 12 2023, 11:33 AM
reames requested review of this revision.May 12 2023, 11:33 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 12 2023, 11:33 AM
reames planned changes to this revision.May 12 2023, 11:37 AM

shl is not commutative.

craig.topper added inline comments.May 12 2023, 11:41 AM
llvm/lib/Target/RISCV/RISCVGatherScatterLowering.cpp
240

This might have been a hacky way of ensuring that the shift amount was the loop invariant splat part? the code right after the switch assumes the instructions are commutable.

reames updated this revision to Diff 521755.May 12 2023, 12:02 PM
reames edited the summary of this revision. (Show Details)

Address the commutativity bug.

This revision is now accepted and ready to land.May 12 2023, 12:04 PM
This revision was landed with ongoing or failed builds.May 12 2023, 12:13 PM
This revision was automatically updated to reflect the committed changes.