This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][GlobalISel] Optimize conjunctions of compares to conditional conmpares.
ClosedPublic

Authored by aemerson on Jan 12 2022, 3:27 PM.

Details

Summary

This is a partial port of the same optimization from AArch64ISelLowering, although the original handles more cases when generating regular compares instead of this one which just does it when selecting G_SELECTs.

For more detailed comments see the original comments for emitConditionalComparison() in AArch64ISelLowering.

Gives minor code size improvements.

Diff Detail

Event Timeline

aemerson created this revision.Jan 12 2022, 3:27 PM
paquette accepted this revision.Jan 12 2022, 4:09 PM

LGTM, just have minor nits

llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
1331

should this be named like changeFPCCToORAArch64CC to match changeFPCCToANDAArch64CC?

4864
4933

comment seems inaccurate considering the FP case is handled right below?

5052

should this use emitSelect?

This revision is now accepted and ready to land.Jan 12 2022, 4:09 PM
aemerson added inline comments.Jan 12 2022, 8:56 PM
llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
5052

Nice, that improves one of the test cases further.

This revision was landed with ongoing or failed builds.Feb 20 2022, 1:21 AM
This revision was automatically updated to reflect the committed changes.