[llvm] [VPlan] Improve code around canConstantBeExtended (NFC) (PR #161652)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 16 02:19:56 PDT 2025


================
@@ -188,7 +188,23 @@ struct bind_const_int {
     const auto *CI = dyn_cast<ConstantInt>(V);
     if (!CI)
       return false;
-    if (auto C = CI->getValue().tryZExtValue()) {
+    Res = &CI->getValue();
+    return true;
+  }
+};
+
+inline bind_apint m_APInt(const APInt *&C) { return C; }
+
+struct bind_const_int {
----------------
david-arm wrote:

Seems like a sensible change!

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


More information about the llvm-commits mailing list