[llvm] s390x: pattern match saturated truncation (PR #155377)
Ulrich Weigand via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 26 04:46:54 PDT 2025
================
@@ -1067,6 +1067,15 @@ def vsplat_imm_eq_1 : PatFrag<(ops), (build_vector), [{
}]>;
def z_vzext1 : PatFrag<(ops node:$x), (and node:$x, vsplat_imm_eq_1)>;
+def vsplat_imm_eq_s32_min : PatFrag<(ops), (build_vector), [{
+ APInt Imm;
+ return ISD::isConstantSplatVector(N, Imm) && Imm.getSExtValue() == -32768;
----------------
uweigand wrote:
Ah, right. You can probably generalize this function to determine the type (from `N`) and check for the type's minimum/maximum values programmatically.
https://github.com/llvm/llvm-project/pull/155377
More information about the llvm-commits
mailing list