This is an archive of the discontinued LLVM Phabricator instance.

[GlobalISel] Fix AArch64 ICMP instruction selection
ClosedPublic

Authored by kristof.beyls on Dec 30 2016, 7:52 AM.

Details

Summary

CSINC increments the result by one when the condition is false. The existing code seems to assume it increases the result by one if the condition is true.
The simple fix is to inverse the predicate during ICMP instruction selection.

This dramatically increases the execution pass rate in the test-suite run with -mllvm -global-isel=true -mllvm -global-isel-abort=1 from 13.7% to 47.2%!
Not too surprising giving we were always lowering ICMP incorrectly so far...

Diff Detail

Repository
rL LLVM

Event Timeline

kristof.beyls retitled this revision from to [GlobalISel] Fix AArch64 ICMP instruction selection.
kristof.beyls updated this object.
kristof.beyls added a subscriber: llvm-commits.
qcolombet accepted this revision.Jan 4 2017, 4:14 PM
qcolombet edited edge metadata.

Hi Kristof,

LGTM.
Nitpicks below.

Thanks,
-Quentin

lib/Target/AArch64/AArch64InstructionSelector.cpp
1079 ↗(On Diff #82727)

Could you add a comment why we do this?
Exactly what you said in the summary of the patch would be good.

This revision is now accepted and ready to land.Jan 4 2017, 4:15 PM
This revision was automatically updated to reflect the committed changes.