[AArch64][GlobalISel] Perform load/store extended reg folding with optsize

GlobalISel was only doing this with minsize. SDAG does this with optsize.

(See: `SelectionDAG::shouldOptForSize()`)

This is a 0.3% code size improvement for CTMark at -Os.

(Best: 1.1% improvements on lencod + pairlocalalign)

Differential Revision: https://reviews.llvm.org/D96451
This commit is contained in:
Jessica Paquette 2021-02-10 14:07:36 -08:00
parent 3a5f8a3ea3
commit 5f7a4d8d05
2 changed files with 2 additions and 2 deletions

View File

@ -5219,7 +5219,7 @@ bool AArch64InstructionSelector::isWorthFoldingIntoExtendedReg(
// Always fold if there is one use, or if we're optimizing for size.
Register DefReg = MI.getOperand(0).getReg();
if (MRI.hasOneNonDBGUse(DefReg) ||
MI.getParent()->getParent()->getFunction().hasMinSize())
MI.getParent()->getParent()->getFunction().hasOptSize())
return true;
// It's better to avoid folding and recomputing shifts when we don't have a

View File

@ -23,7 +23,7 @@
define void @ldrhrox(i64* %addr) { ret void }
define void @ldbbrox(i64* %addr) { ret void }
define void @ldrqrox(i64* %addr) { ret void }
attributes #0 = { optsize minsize }
attributes #0 = { optsize }
attributes #1 = { "target-features"="+lsl-fast" }
...