This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Enable alias analysis by default
ClosedPublic

Authored by Yunzezhu on Aug 6 2023, 7:53 PM.

Details

Summary

In llvm alias analysis is off by default now.
This patch enable alias analysis on RISCV target during code generation by default,
and this makes more chances for improving performance.
Modified related test cases.

Diff Detail

Event Timeline

Yunzezhu created this revision.Aug 6 2023, 7:53 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 6 2023, 7:53 PM
Yunzezhu requested review of this revision.Aug 6 2023, 7:53 PM
kito-cheng added inline comments.Aug 6 2023, 7:58 PM
llvm/test/CodeGen/RISCV/vararg.ll
498–499

Ooops, why we got an extra store here after enable AA ?

Please put a cl::opt on this. I think Aarch64 has one

Yunzezhu updated this revision to Diff 548044.Aug 7 2023, 8:19 PM
Yunzezhu added a reviewer: kito-cheng.

Added cl::opt for useAA.

Yunzezhu added inline comments.Aug 7 2023, 8:20 PM
llvm/test/CodeGen/RISCV/vararg.ll
498–499

Ooops, why we got an extra store here after enable AA ?

When AA is not enabled, a store node is legalized from vastart, this node is not parallel with other store nodes and is not directly chained to token factor, so in later combine this node becomes dead node and get removed.
When AA is enabled, this store node is made parallel with other store nodes and chained to same token factor, so it is not seen as dead node and remains after combining.

kito-cheng added a comment.EditedAug 8 2023, 2:08 AM
This comment has been deleted.
llvm/test/CodeGen/RISCV/vararg.ll
498–499

Thank you for explanation :) I am OK with this little code gen degradation since enable AA sounds reasonable in general, but I would like defer the final decision to @asb and @craig.topper

asb accepted this revision.Aug 8 2023, 11:33 AM

It looks like this is positive over all and multiple other backends have made the same choice. It seems Arm - D69796, AArch64 - D98781, AMDGPU - D89320, Hexagon, PPC - D48663, SystemZ, WebAssembly.

This revision is now accepted and ready to land.Aug 8 2023, 11:33 AM
This revision was landed with ongoing or failed builds.Aug 9 2023, 7:54 PM
This revision was automatically updated to reflect the committed changes.