This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Add isel patterns to select vsub_vx intrinsic to vadd.vi if it uses a small enough immediate
ClosedPublic

Authored by craig.topper on Mar 30 2021, 9:50 PM.

Details

Summary

Also modify the simm5_plus1 check because Imm-1 is UB if Imm happens
to be INT64_MIN. I don't think the compiler would optimize based on that in this
usage, but it could fail UBSan or -ftrapv.

Diff Detail

Event Timeline

craig.topper created this revision.Mar 30 2021, 9:50 PM
craig.topper requested review of this revision.Mar 30 2021, 9:50 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 30 2021, 9:50 PM
Herald added a subscriber: MaskRay. · View Herald Transcript

Upload the patterns too.

craig.topper retitled this revision from [RISCV] Add isel patterns to select vsub_vx intrinsic to vadd.vi if the immediate is small enough. to [RISCV] Add isel patterns to select vsub_vx intrinsic to vadd.vi if it uses a small enough immediate.Mar 30 2021, 9:55 PM
craig.topper edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Mar 31 2021, 2:06 AM
frasercrmck accepted this revision.Mar 31 2021, 2:29 AM