[llvm] [InstSimplify] Consider vscale_range for get active lane mask (PR #160073)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 23 12:47:24 PDT 2025


================
@@ -6474,10 +6474,27 @@ Value *llvm::simplifyBinaryIntrinsic(Intrinsic::ID IID, Type *ReturnType,
                                      const CallBase *Call) {
   unsigned BitWidth = ReturnType->getScalarSizeInBits();
   switch (IID) {
-  case Intrinsic::get_active_lane_mask:
+  case Intrinsic::get_active_lane_mask: {
     if (match(Op1, m_Zero()))
       return ConstantInt::getFalse(ReturnType);
+
+    const Function *F = Call->getFunction();
+    auto ScalableTy = dyn_cast<ScalableVectorType>(ReturnType);
----------------
nikic wrote:

```suggestion
    auto *ScalableTy = dyn_cast<ScalableVectorType>(ReturnType);
```

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


More information about the llvm-commits mailing list