[PATCH] D88217: [GVN] Make propagateEquality look into the operand of freeze

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 24 12:08:48 PDT 2020


aqjune added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/GVN.cpp:1993
     uint32_t LVN = VN.lookupOrAdd(LHS);
-    if ((isa<Argument>(LHS) && isa<Argument>(RHS)) ||
-        (isa<Instruction>(LHS) && isa<Instruction>(RHS))) {
+    if ((!LHSFr || isa<FreezeInst>(RHS)) &&
+        ((isa<Argument>(LHS) && isa<Argument>(RHS)) ||
----------------
efriedma wrote:
> I guess favoring "prefer the non-freeze" over "prefer the oldest" is a heuristic?
Yes. I chose the heuristic because replacing non-freeze with freeze may cause later optimizations that are unaware of freeze.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88217



More information about the llvm-commits mailing list