[llvm] [PPC] Set minimum of largest number of comparisons to use bit test for switch lowering (PR #155910)

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 21 14:02:53 PDT 2025


================
@@ -2120,6 +2126,14 @@ bool TargetLoweringBase::isJumpTableRelative() const {
   return getTargetMachine().isPositionIndependent();
 }
 
+unsigned TargetLoweringBase::getMinimumBitTestCmps() const {
+  return MinimumBitTestCmps;
+}
+
+void TargetLoweringBase::setMinimumBitTestCmps(unsigned Val) {
+  MinimumBitTestCmps = Val;
----------------
efriedma-quic wrote:

This is setting the command-line flag?  That's a problem: it's not thread-safe.

Not sure if this is an existing pattern, but it's not something you should follow.  Either use a virtual method, or add a member variable to TargetLoweringBase.

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


More information about the llvm-commits mailing list