From 7b0c078ac9d765b26c5426461c1c0f18a5cfe3f9 Mon Sep 17 00:00:00 2001 From: AZero13 Date: Mon, 15 Sep 2025 12:49:15 -0400 Subject: [PATCH] [ARM] isShifterOpProfitable should return true if we are optimizing for size --- llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp b/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp index 9ad46df159c20..a201d81507e9d 100644 --- a/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp +++ b/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp @@ -542,7 +542,7 @@ bool ARMDAGToDAGISel::isShifterOpProfitable(const SDValue &Shift, unsigned ShAmt) { if (!Subtarget->isLikeA9() && !Subtarget->isSwift()) return true; - if (Shift.hasOneUse()) + if (Shift.hasOneUse() || CurDAG->shouldOptForSize()) return true; // R << 2 is free. return ShOpcVal == ARM_AM::lsl &&