This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Improve if-conversion for M-class CPUs without branch predictors
ClosedPublic

Authored by john.brawn on Jun 20 2017, 5:51 AM.

Details

Summary

The current heuristic in isProfitableToIfCvt assumes we have a branch predictor, and so gives the wrong answer in some cases when we don't. This patch adds a subtarget feature to indicate that a subtarget has no branch predictor, and changes the heuristic in isProfitableToiIfCvt when it's present. This gives a slight overall improvement in a set of embedded benchmarks on Cortex-M4 and Cortex-M33.

Diff Detail

Repository
rL LLVM

Event Timeline

john.brawn created this revision.Jun 20 2017, 5:51 AM
javed.absar added inline comments.Jun 20 2017, 7:04 AM
lib/Target/ARM/ARMScheduleM3.td
1 ↗(On Diff #103189)

Add header to ARMScheduleM3.td.

jmolloy accepted this revision.Jun 28 2017, 3:11 AM
jmolloy added a subscriber: jmolloy.

Hi John,

The non-scheduling parts LGTM. I'll let Javed OK the scheduling parts.

James

This revision is now accepted and ready to land.Jun 28 2017, 3:11 AM

scheduling part LGTM now

This revision was automatically updated to reflect the committed changes.