[llvm] 01487f3 - [TypePromotion] Deference pointer before printing it in a debug message.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 2 23:45:37 PST 2023


Author: Craig Topper
Date: 2023-03-02T23:43:36-08:00
New Revision: 01487f384a1eeb664bc6803cc996054f838eda95

URL: https://github.com/llvm/llvm-project/commit/01487f384a1eeb664bc6803cc996054f838eda95
DIFF: https://github.com/llvm/llvm-project/commit/01487f384a1eeb664bc6803cc996054f838eda95.diff

LOG: [TypePromotion] Deference pointer before printing it in a debug message.

Without deferencing it just prints the value of the pointer which
isn't meaningful. Dereferencing prints the operand.

Added: 
    

Modified: 
    llvm/lib/CodeGen/TypePromotion.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/TypePromotion.cpp b/llvm/lib/CodeGen/TypePromotion.cpp
index e6c0b3242d67..028ca7bc25d7 100644
--- a/llvm/lib/CodeGen/TypePromotion.cpp
+++ b/llvm/lib/CodeGen/TypePromotion.cpp
@@ -960,8 +960,8 @@ bool TypePromotionImpl::run(Function &F, const TargetMachine *TM,
 
       if (isa<ZExtInst>(&I) && isa<PHINode>(I.getOperand(0)) &&
           isa<IntegerType>(I.getType()) && BBIsInLoop(&BB)) {
-        LLVM_DEBUG(dbgs() << "IR Promotion: Searching from: " << I.getOperand(0)
-                          << "\n");
+        LLVM_DEBUG(dbgs() << "IR Promotion: Searching from: "
+                          << *I.getOperand(0) << "\n");
         EVT ZExtVT = TLI->getValueType(DL, I.getType());
         Instruction *Phi = static_cast<Instruction *>(I.getOperand(0));
         auto PromoteWidth = ZExtVT.getFixedSizeInBits();


        


More information about the llvm-commits mailing list