This is an archive of the discontinued LLVM Phabricator instance.

[ARM][CostModel] CodeSize costs for i1 arith ops
ClosedPublic

Authored by samparker on Aug 25 2020, 4:31 AM.

Details

Summary

When optimising for size, make the cost of i1 logical operations relatively expensive so that optimisations don't try to combine predicates.

Diff Detail

Event Timeline

samparker created this revision.Aug 25 2020, 4:31 AM
SjoerdMeijer added inline comments.Sep 7 2020, 1:16 AM
llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
1043

I was wondering if this should be ST->isThumb2() perhaps? Or does it not matter, this didn't show unexpected regressions?

samparker added inline comments.Sep 7 2020, 1:21 AM
llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
1043

I've included Thumb too because these operations would be even more expensive without IT support. There were some cases of increases in code size, see D86526, but overall this is a win.

SjoerdMeijer accepted this revision.Sep 7 2020, 1:24 AM
SjoerdMeijer added inline comments.
llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
1043

Ah yes, cheers, makes sense. LGTM

This revision is now accepted and ready to land.Sep 7 2020, 1:24 AM
This revision was automatically updated to reflect the committed changes.