[llvm] a9c7ba9 - [AMDGPU] Fix a warning

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 12 14:02:13 PDT 2023


Author: Kazu Hirata
Date: 2023-09-12T14:02:07-07:00
New Revision: a9c7ba964fd3a2bbfcd9e3a3ab9cfde2dc99607c

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

LOG: [AMDGPU] Fix a warning

This patch fixes:

  llvm/lib/Target/AMDGPU/AMDGPU.h:297:18: error: private field 'TM' is
  not used [-Werror,-Wunused-private-field]

Added: 
    

Modified: 
    llvm/lib/Target/AMDGPU/AMDGPU.h
    llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AMDGPU/AMDGPU.h b/llvm/lib/Target/AMDGPU/AMDGPU.h
index 6234c10996bbbb9..3d00df59cfe4887 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPU.h
+++ b/llvm/lib/Target/AMDGPU/AMDGPU.h
@@ -293,11 +293,8 @@ extern char &AMDGPURewriteUndefForPHILegacyPassID;
 
 class AMDGPURewriteUndefForPHIPass
     : public PassInfoMixin<AMDGPURewriteUndefForPHIPass> {
-private:
-  TargetMachine &TM;
-
 public:
-  AMDGPURewriteUndefForPHIPass(TargetMachine &TM) : TM(TM){};
+  AMDGPURewriteUndefForPHIPass() = default;
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
 

diff  --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp b/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
index fc703cfd0972840..074280b59e82f4b 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
@@ -664,7 +664,7 @@ void AMDGPUTargetMachine::registerPassBuilderCallbacks(PassBuilder &PB) {
           return true;
         }
         if (PassName == "amdgpu-rewrite-undef-for-phi") {
-          PM.addPass(AMDGPURewriteUndefForPHIPass(*this));
+          PM.addPass(AMDGPURewriteUndefForPHIPass());
           return true;
         }
         return false;


        


More information about the llvm-commits mailing list