[llvm] 03612b2 - [AMDGPU] Fix an unused variable warning

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 21 16:15:46 PDT 2023


Author: Kazu Hirata
Date: 2023-07-21T16:14:41-07:00
New Revision: 03612b2c1aa2e340d1d12c6dbde94c35bc66a43a

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

LOG: [AMDGPU] Fix an unused variable warning

This patch fixes:

  llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp:1006:9: error:
  unused variable 'Ty' [-Werror,-Wunused-variable]

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp b/llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
index 5c0b3e7b50f037..4ec85f3c55884c 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
@@ -1003,8 +1003,7 @@ Value *AMDGPUCodeGenPrepareImpl::optimizeWithFDivFast(
     return nullptr;
 
   // Only have fdiv.fast for f32.
-  Type *Ty = Den->getType();
-  assert(Ty->isFloatTy());
+  assert(Den->getType()->isFloatTy());
 
   bool NumIsOne = false;
   if (const ConstantFP *CNum = dyn_cast<ConstantFP>(Num)) {


        


More information about the llvm-commits mailing list