[PATCH] D130554: [AArch64][GlobalISel] Add heuristics for localizing G_CONSTANT.

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 26 11:33:50 PDT 2022


paquette added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:20778
+  // us spending time traversing uses if all we want to know is if it's >= min.
+  auto isUsesAtMost = [&](unsigned Reg, unsigned MaxUses) {
+    unsigned NumUses = 0;
----------------
This seems like it could be a helper function in MachineRegisterInfo

(or there should be some sort of helper in STLExtras for testing if a range is at most some #elts long)


================
Comment at: llvm/test/CodeGen/AArch64/GlobalISel/localizer-arm64-tti.ll:117
 
+define i32 @imm_cost_too_large() {
+  ; CHECK-LABEL: name: imm_cost_too_large
----------------
this looks like it tests the

```
    if (RematCost == 2)
      return 2U;
```

path right?

what about the other two possible values for `RematCost`?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130554



More information about the llvm-commits mailing list