[llvm] b174689 - [AMDGPU] Fix -Wunused-variable in non-assertion builds after #109818

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 11 08:52:21 PDT 2024


Author: Fangrui Song
Date: 2024-10-11T08:52:11-07:00
New Revision: b1746894deebe3fa8d0d18e56c0d33c37ef916cd

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

LOG: [AMDGPU] Fix -Wunused-variable in non-assertion builds after #109818

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AMDGPU/SIPreEmitPeephole.cpp b/llvm/lib/Target/AMDGPU/SIPreEmitPeephole.cpp
index 8cb98ed4ecf881..701084844cd9b4 100644
--- a/llvm/lib/Target/AMDGPU/SIPreEmitPeephole.cpp
+++ b/llvm/lib/Target/AMDGPU/SIPreEmitPeephole.cpp
@@ -347,10 +347,7 @@ class BranchWeightCostModel {
 bool SIPreEmitPeephole::mustRetainExeczBranch(
     const MachineInstr &Branch, const MachineBasicBlock &From,
     const MachineBasicBlock &To) const {
-
-  const MachineBasicBlock &Head = *Branch.getParent();
-  assert(is_contained(Head.successors(), &From));
-
+  assert(is_contained(Branch.getParent()->successors(), &From));
   BranchWeightCostModel CostModel{*TII, Branch, From};
 
   const MachineFunction *MF = From.getParent();


        


More information about the llvm-commits mailing list