[llvm] edb05d5 - [llvm] Inline getAssociatedFunction() in LLVM_DEBUG.

Alexander Belyaev via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 24 02:51:28 PDT 2021


Author: Alexander Belyaev
Date: 2021-07-24T11:49:21+02:00
New Revision: edb05d555e6a121fc853fbb000b73570af0ea197

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

LOG: [llvm] Inline getAssociatedFunction() in LLVM_DEBUG.

Function* F is used only inside LLVM_DEBUG, so that it causes unused
variable warning.

Added: 
    

Modified: 
    llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp b/llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp
index 7495b592b666..61b1d22edc33 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp
@@ -240,13 +240,12 @@ struct AAAMDWorkGroupSizeFunction : public AAAMDWorkGroupSize {
   }
 
   ChangeStatus updateImpl(Attributor &A) override {
-    Function *F = getAssociatedFunction();
     ChangeStatus Change = ChangeStatus::UNCHANGED;
 
     auto CheckCallSite = [&](AbstractCallSite CS) {
       Function *Caller = CS.getInstruction()->getFunction();
       LLVM_DEBUG(dbgs() << "[AAAMDWorkGroupSize] Call " << Caller->getName()
-                        << "->" << F->getName() << "\n");
+                        << "->" << getAssociatedFunction()->getName() << "\n");
 
       const auto &CallerInfo = A.getAAFor<AAAMDWorkGroupSize>(
           *this, IRPosition::function(*Caller), DepClassTy::REQUIRED);


        


More information about the llvm-commits mailing list