[PATCH] D145374: [FuncSpec] Consider constant struct arguments when specializing.

Chuanqi Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 14 01:50:12 PDT 2023


ChuanqiXu added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/SCCPSolver.cpp:868-869
+    } else {
+      const ValueLatticeElement &LV = getValueState(V);
+      mergeInValue(getValueState(NewArg), NewArg, LV);
     }
----------------
labrinea wrote:
> ChuanqiXu wrote:
> > This looks not the same with the original statements. For example, we won't do anything if V is the OldArg and ValueState doesn't contain the OldArg.
> Looking at what `handleCallArguments()` does, makes me think that `OldArg` ought to be in either `ValueState` or `StructValueState`. That said I am wondering whether it's better to just call `Solver.visit(CallSite)` for the callsites of specializations right after we've updated them. This would essentially make `markArgInFuncSpecialization()` obsolete. Lemme try this and run a few tests.
Agreed. It looks cleaner at least.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D145374



More information about the llvm-commits mailing list