[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:33:43 PST 2021


aemerson added inline comments.


================
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:
> aemerson wrote:
> > 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.
> Also, why the MachineFunction variant versus the MachineBasicBlock variant? Is there a difference in size if you use the MBB variant?
You only want to directly use the MBB variant if you know you have a non-null PSI and BFI available (because the MBB one is for using PGO info). Otherwise, you use the MF variant which delegates to the MBB one if it's available.


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