]> granicus.if.org Git - llvm/commitdiff
[WebAssembly] Print a debug message at the start of each pass
authorHeejin Ahn <aheejin@gmail.com>
Wed, 9 Jan 2019 23:05:21 +0000 (23:05 +0000)
committerHeejin Ahn <aheejin@gmail.com>
Wed, 9 Jan 2019 23:05:21 +0000 (23:05 +0000)
Summary:
Looks like many passes print its pass description as a debug message at
the start of each pass, so added that to (mostly newly added) other
passes as well.

Reviewers: dschuff

Subscribers: jgravelle-google, sbc100, sunfish, llvm-commits

Differential Revision: https://reviews.llvm.org/D56142

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350771 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/WebAssembly/WebAssemblyAddMissingPrototypes.cpp
lib/Target/WebAssembly/WebAssemblyCallIndirectFixup.cpp
lib/Target/WebAssembly/WebAssemblyEHRestoreStackPointer.cpp
lib/Target/WebAssembly/WebAssemblyExceptionInfo.cpp
lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp
lib/Target/WebAssembly/WebAssemblyISelDAGToDAG.cpp
lib/Target/WebAssembly/WebAssemblyLateEHPrepare.cpp
lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp
lib/Target/WebAssembly/WebAssemblyLowerGlobalDtors.cpp
lib/Target/WebAssembly/WebAssemblyOptimizeReturned.cpp

index 3f17160964b6e537f96c664ede240be6802940d4..e49e2b67f4353217845d6b0db4e976f98db7568e 100644 (file)
@@ -60,7 +60,7 @@ ModulePass *llvm::createWebAssemblyAddMissingPrototypes() {
 }
 
 bool WebAssemblyAddMissingPrototypes::runOnModule(Module &M) {
-  LLVM_DEBUG(dbgs() << "runnning AddMissingPrototypes\n");
+  LLVM_DEBUG(dbgs() << "********** Add Missing Prototypes **********\n");
 
   std::vector<std::pair<Function *, Function *>> Replacements;
 
index 326e838052d8203e70dbed5765ae8a15e0308a79..aaa6d286598ffca5f39863427f0acc26df40dd8e 100644 (file)
@@ -98,7 +98,7 @@ static bool IsPseudoCallIndirect(const MachineInstr &MI) {
 
 bool WebAssemblyCallIndirectFixup::runOnMachineFunction(MachineFunction &MF) {
   LLVM_DEBUG(dbgs() << "********** Fixing up CALL_INDIRECTs **********\n"
-                    << MF.getName() << '\n');
+                    << "********** Function: " << MF.getName() << '\n');
 
   bool Changed = false;
   const WebAssemblyInstrInfo *TII =
index bd1ab472c1e29ff6a5d0acbe26d5056f1f473bce..c86260ba408c552c1299e813fefdbe71863dfcce 100644 (file)
@@ -53,6 +53,10 @@ FunctionPass *llvm::createWebAssemblyEHRestoreStackPointer() {
 
 bool WebAssemblyEHRestoreStackPointer::runOnMachineFunction(
     MachineFunction &MF) {
+  LLVM_DEBUG(dbgs() << "********** EH Restore Stack Pointer **********\n"
+                       "********** Function: "
+                    << MF.getName() << '\n');
+
   const auto *FrameLowering = static_cast<const WebAssemblyFrameLowering *>(
       MF.getSubtarget().getFrameLowering());
   if (!FrameLowering->needsPrologForEH(MF))
index dca7902b8fb920830f43958a552fdfd3a3361b3f..6b3a3e765786a652c9496ceedfad87b302fe182f 100644 (file)
@@ -32,7 +32,10 @@ INITIALIZE_PASS_DEPENDENCY(MachineDominanceFrontier)
 INITIALIZE_PASS_END(WebAssemblyExceptionInfo, DEBUG_TYPE,
                     "WebAssembly Exception Information", true, true)
 
-bool WebAssemblyExceptionInfo::runOnMachineFunction(MachineFunction &F) {
+bool WebAssemblyExceptionInfo::runOnMachineFunction(MachineFunction &MF) {
+  LLVM_DEBUG(dbgs() << "********** Exception Info Calculation **********\n"
+                       "********** Function: "
+                    << MF.getName() << '\n');
   releaseMemory();
   auto &MDT = getAnalysis<MachineDominatorTree>();
   auto &MDF = getAnalysis<MachineDominanceFrontier>();
index 0644f1232f6c3ded6719ab21e561eeda4ed02fbb..1a416520f97d09157866336472aea74d744cfb40 100644 (file)
@@ -228,6 +228,8 @@ static Function *CreateWrapper(Function *F, FunctionType *Ty) {
 }
 
 bool FixFunctionBitcasts::runOnModule(Module &M) {
+  LLVM_DEBUG(dbgs() << "********** Fix Function Bitcasts **********\n");
+
   Function *Main = nullptr;
   CallInst *CallMain = nullptr;
   SmallVector<std::pair<Use *, Function *>, 0> Uses;
index bfef765c27869779509b1c7764e8a4fd144574a3..29678f37ae20bf0c757b651e44c25c48dd9a647b 100644 (file)
@@ -50,6 +50,10 @@ public:
   }
 
   bool runOnMachineFunction(MachineFunction &MF) override {
+    LLVM_DEBUG(dbgs() << "********** ISelDAGToDAG **********\n"
+                         "********** Function: "
+                      << MF.getName() << '\n');
+
     ForCodeSize = MF.getFunction().hasFnAttribute(Attribute::OptimizeForSize) ||
                   MF.getFunction().hasFnAttribute(Attribute::MinSize);
     Subtarget = &MF.getSubtarget<WebAssemblySubtarget>();
index 258d45997fefd322cad3669cc11ee446a2582549..ad838dfb574a27c79b682d9eab18a024a694d250 100644 (file)
@@ -103,6 +103,10 @@ static void eraseDeadBBsAndChildren(const Container &MBBs) {
 }
 
 bool WebAssemblyLateEHPrepare::runOnMachineFunction(MachineFunction &MF) {
+  LLVM_DEBUG(dbgs() << "********** Late EH Prepare **********\n"
+                       "********** Function: "
+                    << MF.getName() << '\n');
+
   if (MF.getTarget().getMCAsmInfo()->getExceptionHandlingType() !=
       ExceptionHandling::Wasm)
     return false;
index 8755198f45b52481ae73854e18d8d7248e93a380..0491f71cea7f1c0fa8689bc2fd4ff736bf5a7f51 100644 (file)
@@ -623,6 +623,8 @@ void WebAssemblyLowerEmscriptenEHSjLj::rebuildSSA(Function &F) {
 }
 
 bool WebAssemblyLowerEmscriptenEHSjLj::runOnModule(Module &M) {
+  LLVM_DEBUG(dbgs() << "********** Lower Emscripten EH & SjLj **********\n");
+
   LLVMContext &C = M.getContext();
   IRBuilder<> IRB(C);
 
index 3988189ba7ce73eaad2a591208da78c0ec20dab7..84c877cb8d0282424d1eb9a5898f561c2a0bbfb0 100644 (file)
@@ -59,6 +59,8 @@ ModulePass *llvm::createWebAssemblyLowerGlobalDtors() {
 }
 
 bool LowerGlobalDtors::runOnModule(Module &M) {
+  LLVM_DEBUG(dbgs() << "********** Lower Global Destructors **********\n");
+
   GlobalVariable *GV = M.getGlobalVariable("llvm.global_dtors");
   if (!GV)
     return false;
index 113ee2532bce2ff2e1ee78829a262d04e10e3a3d..2c018d0785a70513fa88e31619bfd2a9635f5b25 100644 (file)
@@ -74,6 +74,10 @@ void OptimizeReturned::visitCallSite(CallSite CS) {
 }
 
 bool OptimizeReturned::runOnFunction(Function &F) {
+  LLVM_DEBUG(dbgs() << "********** Optimize returned Attributes **********\n"
+                       "********** Function: "
+                    << F.getName() << '\n');
+
   DT = &getAnalysis<DominatorTreeWrapperPass>().getDomTree();
   visit(F);
   return true;