This is an archive of the discontinued LLVM Phabricator instance.

Enable constexpr on ROTATELEFT/ROTATERIGHT builtin intrinsics (PR47249)
ClosedPublic

Authored by RKSimon on Aug 21 2020, 4:44 AM.

Details

Summary

This enables us to use the builtin_rotateleft / builtin_rotateright 8/16/32/64 intrinsics inside constexpr code.

Diff Detail

Event Timeline

RKSimon created this revision.Aug 21 2020, 4:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 21 2020, 4:44 AM
RKSimon requested review of this revision.Aug 21 2020, 4:44 AM
erichkeane accepted this revision.Aug 21 2020, 10:43 AM

Its a bit of a shame that the two implementations (left/right) differ by only a single character, an y ideas for combining them cleanly? I might also consider combining the two 'if' statements into a single one (if !EvalInteger(E->getArg(0)...) || !EvalInteger(E->getArg(1)...), but that is generally just preference.

Otherwise, LGTM.

This revision is now accepted and ready to land.Aug 21 2020, 10:43 AM

(Same comments as for the bitreverse patch.)