This is an archive of the discontinued LLVM Phabricator instance.

[SCEV] Add SCEVType to represent `vscale`.
ClosedPublic

Authored by paulwalker-arm on Feb 27 2023, 10:03 AM.

Details

Summary

This is part of an effort to remove ConstantExpr based
representations of vscale so that its LangRef definiton can
be relaxed to accommodate a less strict definition of constant.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptFeb 27 2023, 10:03 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
paulwalker-arm requested review of this revision.Feb 27 2023, 10:03 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 27 2023, 10:03 AM

This patch follows on from a conversation on D144624. I've tried to keep things conservative (i.e. no llvm.vscale() detection or use of vscale_range attributes) so as not to change existing behaviour, hence no test changes.

Allen added a subscriber: Allen.Feb 27 2023, 10:10 AM
efriedma added a subscriber: efriedma.

Seems reasonable to me.

llvm/lib/Analysis/ScalarEvolution.cpp
730

The "return 0" shouldn't be reachable; if two vscales have the same type, "LHS == RHS" should be true.

You can probably just skip checking "if (LTy != RTy)".

nikic accepted this revision.Feb 27 2023, 11:44 AM

LGTM

This revision is now accepted and ready to land.Feb 27 2023, 11:44 AM
This revision was landed with ongoing or failed builds.Mar 2 2023, 3:41 AM
This revision was automatically updated to reflect the committed changes.

Hi, I am seeing some inefficient codegen after this patch for AArch64 SVE, created a github issue: https://github.com/llvm/llvm-project/issues/61742