This is an archive of the discontinued LLVM Phabricator instance.

[LoongArch] Implement the convertSelectOfConstantsToMath hook
ClosedPublic

Authored by gonglingqin on Feb 8 2023, 6:46 PM.

Details

Summary

Normally, the ISD::SELECT is lowered to maskeqz + masknez. This is
inefficient when operands are constants that can be computed easily.
To avoid that, override TargetLowering::convertSelectOfConstantsToMath.

Diff Detail

Event Timeline

gonglingqin created this revision.Feb 8 2023, 6:46 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 8 2023, 6:46 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
gonglingqin requested review of this revision.Feb 8 2023, 6:46 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 8 2023, 6:46 PM
xen0n accepted this revision.Feb 8 2023, 10:35 PM

Some nice improvements it seems!

This revision is now accepted and ready to land.Feb 8 2023, 10:35 PM