[PATCH] D141680: [GVN] Refactor findDominatingLoad function

Mikael Holmén via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 11 06:01:12 PDT 2023


uabelho added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/GVN.cpp:1123
+      // Stop the search if limit is reached.
+      if (++NumVisitedInsts > MaxNumVisitedInsts)
+        return nullptr;
----------------
This limit and the fact that we iterate over all instructions in the BB (including debug instructions/intrinsics) unfortunately makes GVN behave in different ways depending on if we have debug information present or not.

This can be seen with
 opt "-passes=gvn" bbi-86242.ll -S -o -
{F29187866}

If we remove the debug intrinsics from the input we see that GVN does more changes than with the debug stuff present
(the input can probably be reduced a lot if we pass -gvn-max-num-visited-insts=<something small> to opt).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141680



More information about the llvm-commits mailing list