Page MenuHomePhabricator

[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.Mon, Sep 7, 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.Mon, Sep 7, 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.Mon, Sep 7, 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.Mon, Sep 7, 1:24 AM
This revision was automatically updated to reflect the committed changes.