This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Fix wrong operand being used for VL in shift combine
ClosedPublic

Authored by luke on Aug 23 2023, 9:31 AM.

Details

Summary

At some point a merge operand was added to the binary vl ops, so this combine
was using the mask for the VL. This causes a crash when trying to
select the vmv_v_x_vl, which showed up locally when messing about with
selectVSplat, but thankfully in ToT the vmv_v_x_vl gets pattern matched
away into the .vx and .vi operands every time, so there's no noticeable
change.

Diff Detail

Event Timeline

luke created this revision.Aug 23 2023, 9:31 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 23 2023, 9:31 AM
luke requested review of this revision.Aug 23 2023, 9:31 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 23 2023, 9:31 AM
luke added inline comments.Aug 23 2023, 9:34 AM
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
13729

Not specific to this patch, but I think with D158625 this combine might be doing the same thing as SimplifyDemanded. I.e. SimplifyDemanded has the ability to mark the upper hi bits of a build_pair as undef in a rotr/rotl (but this only seems to work on fixed vectors currently)

This revision is now accepted and ready to land.Aug 23 2023, 9:38 AM
This revision was landed with ongoing or failed builds.Aug 23 2023, 9:44 AM
This revision was automatically updated to reflect the committed changes.