This is an archive of the discontinued LLVM Phabricator instance.

[VP] Fix VPintrinsic::getStaticVectorLength for vp.merge|select
ClosedPublic

Authored by simoll on Mar 17 2022, 7:48 AM.

Details

Summary

VPIntrinsic::getStaticVectorLength infers the operational vector length of a VPIntrinsic instance from a type that is used with the intrinsic. The function used the mask operand before. Yet, vp.merge|select do not have a mask operand (in the predicating sense that the other VP intrinsics are using them - it is a selection mask for them). Fallback to the return type to fix this.

Diff Detail

Event Timeline

simoll created this revision.Mar 17 2022, 7:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 17 2022, 7:48 AM
simoll requested review of this revision.Mar 17 2022, 7:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 17 2022, 7:48 AM
kaz7 added inline comments.Mar 19 2022, 5:01 PM
llvm/lib/IR/IntrinsicInst.cpp
302–308

Please add assert in then closure to see whether it is vp.select or vp.merge.
Also please add comments to describe why vp.select and vp.merge don't have a mask operand here for future references.

simoll updated this revision to Diff 416837.Mar 21 2022, 1:15 AM
simoll marked an inline comment as done.

Document that vp.merge, vp.select do not have a VP mask and why.

kaz7 accepted this revision.Mar 22 2022, 1:54 AM

Thank you. LGTM.

This revision is now accepted and ready to land.Mar 22 2022, 1:54 AM
This revision was landed with ongoing or failed builds.Mar 22 2022, 3:42 AM
This revision was automatically updated to reflect the committed changes.