[PATCH] D97732: [AArch64][GlobalISel] Enable use of the optsize predicate in the selector.

Amara Emerson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 1 14:22:31 PST 2021


aemerson added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/GlobalISel/InstructionSelector.h:480
+    return MF->getFunction().hasOptSize() ||
+           (PSI && BFI && CurMBB && llvm::shouldOptForSize(*CurMBB, PSI, BFI));
+  }
----------------
arsenm wrote:
> Why would CurMBB ever be null?
Because these predicates get called once by the emitter-generated code before we actually start selecting a function.


================
Comment at: llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp:2438
+          (DefSize == 32 &&
+           (MF.getFunction().hasMinSize() || shouldOptForSize(&MF)))) {
         auto *FPImm = I.getOperand(1).getFPImm();
----------------
paquette wrote:
> I would expect `shouldOptForSize` to return true when `minsize` is present and `optsize` is not present.
> 
> That case seems pretty atypical though. At least with clang, they always appear together.
I didn't realize minsize and optsize could co-exist. Yeah I guess it makes sense to move this logic.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D97732/new/

https://reviews.llvm.org/D97732



More information about the llvm-commits mailing list