[PATCH] D156318: Local: fix debug output of replaceDominatedUsesWith()

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 27 03:36:23 PDT 2023


nikic added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/Local.cpp:2899
       continue;
-    U.set(To);
     LLVM_DEBUG(dbgs() << "Replace dominated use of '" << From->getName()
+                      << "' as " << *To << " in " << *U.getUser() << "\n");
----------------
If you're already here, I think this should either print `*From` or `From->printAsOperand(dbgs())` (the former prints the whole instruction, the latter just the name, but in a way that e.g. also works if it's an unnamed instruction).


================
Comment at: llvm/test/Transforms/Util/local-dbg-print.ll:1
+; RUN: opt -passes=gvn -debug-only=local -disable-output 2>&1 < %s | FileCheck %s
+
----------------
This needs `REQUIRES: asserts`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D156318



More information about the llvm-commits mailing list