This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Adjust the cost model for Exynos M1 and M2
ClosedPublic

Authored by evandro on Aug 25 2017, 9:14 AM.

Details

Summary

Add new predicate to more accurately model the cost of arithmetic and logical operations shifted left.

Diff Detail

Repository
rL LLVM

Event Timeline

evandro created this revision.Aug 25 2017, 9:14 AM
javed.absar added inline comments.Aug 25 2017, 9:29 AM
llvm/lib/Target/AArch64/AArch64InstrInfo.h
372 ↗(On Diff #112704)

Is it for shift left only, and if so should it be then called out explicitly?

MatzeB edited edge metadata.Aug 25 2017, 10:14 AM
  • I'd leave out the if (Subtarget.getProcFamily() != AArch64Subtarget::ExynosM1) return false; check in isExynosShiftExtFast() if someone chose the Exynos scheduling he probably wants that behavior even if getProcFamily() doesn't match. (You can pull the check out to isAsCheapAsAMove()).
  • This must have happened in an earlier commit already, but in any case I'd really discourage the use of Subtarget.getProcFamily(), better create a subtarget feature to control the behavior.
  • I'd leave out the if (Subtarget.getProcFamily() != AArch64Subtarget::ExynosM1) return false; check in isExynosShiftExtFast() if someone chose the Exynos scheduling he probably wants that behavior even if getProcFamily() doesn't match. (You can pull the check out to isAsCheapAsAMove()).

OK

  • This must have happened in an earlier commit already, but in any case I'd really discourage the use of Subtarget.getProcFamily(), better create a subtarget feature to control the behavior.

It's legacy code before the refactoring of such calls that I didn't feel this to be the time to address.

evandro marked an inline comment as done.Aug 25 2017, 12:13 PM
evandro updated this revision to Diff 112736.Aug 25 2017, 1:31 PM
evandro edited the summary of this revision. (Show Details)
evandro updated this revision to Diff 112760.Aug 25 2017, 4:17 PM
MatzeB accepted this revision.Aug 28 2017, 11:55 AM

LGTM

This revision is now accepted and ready to land.Aug 28 2017, 11:55 AM
This revision was automatically updated to reflect the committed changes.