[llvm] [GlobalISel] Remove virtual from GISelValueTracking computeKnownBitsImpl. (PR #158558)

via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 15 00:19:58 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-globalisel

Author: David Green (davemgreen)

<details>
<summary>Changes</summary>

As far as I understand, GISelValueTracking::computeKnownBitsImpl does not need to be virtual, as no-one is specializing / overriding it, which means it is not necessary for the destructor either.

---
Full diff: https://github.com/llvm/llvm-project/pull/158558.diff


1 Files Affected:

- (modified) llvm/include/llvm/CodeGen/GlobalISel/GISelValueTracking.h (+3-4) 


``````````diff
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/GISelValueTracking.h b/llvm/include/llvm/CodeGen/GlobalISel/GISelValueTracking.h
index 3bf9d694b1b21..2db66ba9584a3 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/GISelValueTracking.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/GISelValueTracking.h
@@ -58,15 +58,14 @@ class LLVM_ABI GISelValueTracking : public GISelChangeObserver {
 
 public:
   GISelValueTracking(MachineFunction &MF, unsigned MaxDepth = 6);
-  virtual ~GISelValueTracking() = default;
+  ~GISelValueTracking() = default;
 
   const MachineFunction &getMachineFunction() const { return MF; }
 
   const DataLayout &getDataLayout() const { return DL; }
 
-  virtual void computeKnownBitsImpl(Register R, KnownBits &Known,
-                                    const APInt &DemandedElts,
-                                    unsigned Depth = 0);
+  void computeKnownBitsImpl(Register R, KnownBits &Known,
+                            const APInt &DemandedElts, unsigned Depth = 0);
 
   unsigned computeNumSignBits(Register R, const APInt &DemandedElts,
                               unsigned Depth = 0);

``````````

</details>


https://github.com/llvm/llvm-project/pull/158558


More information about the llvm-commits mailing list