[PATCH] D145896: [Metarenamer] Distinguish phis and other instructions

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 12 23:08:28 PDT 2023


mkazantsev created this revision.
mkazantsev added reviewers: dmakogon, aeubanks, davide, bryantatnvidia.
Herald added subscribers: StephenFan, hiraditya.
Herald added a project: All.
mkazantsev requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Giving phis a special name might be better for understanding of code.


https://reviews.llvm.org/D145896

Files:
  llvm/lib/Transforms/Utils/MetaRenamer.cpp


Index: llvm/lib/Transforms/Utils/MetaRenamer.cpp
===================================================================
--- llvm/lib/Transforms/Utils/MetaRenamer.cpp
+++ llvm/lib/Transforms/Utils/MetaRenamer.cpp
@@ -26,6 +26,7 @@
 #include "llvm/IR/GlobalAlias.h"
 #include "llvm/IR/GlobalVariable.h"
 #include "llvm/IR/Instruction.h"
+#include "llvm/IR/Instructions.h"
 #include "llvm/IR/Module.h"
 #include "llvm/IR/PassManager.h"
 #include "llvm/IR/Type.h"
@@ -115,7 +116,7 @@
 
     for (auto &I : BB)
       if (!I.getType()->isVoidTy())
-        I.setName("inst");
+        I.setName(isa<PHINode>(I) ? "phi" : "inst");
   }
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D145896.504507.patch
Type: text/x-patch
Size: 632 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230313/af441ae2/attachment.bin>


More information about the llvm-commits mailing list