diff --git a/gcc/match.pd b/gcc/match.pd
index 6a7edde5736..c01362ee359 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -2750,16 +2750,24 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
 			       & (bitpos / BITS_PER_UNIT))); }))))
 
 (match min_value
- INTEGER_CST
- (if ((INTEGRAL_TYPE_P (type)
-       || POINTER_TYPE_P(type))
-      && wi::eq_p (wi::to_wide (t), wi::min_value (type)))))
+ uniform_integer_cst_p
+ (with {
+   tree int_cst = uniform_integer_cst_p (t);
+   tree inner_type = TREE_TYPE (int_cst);
+  }
+  (if ((INTEGRAL_TYPE_P (inner_type)
+        || POINTER_TYPE_P (inner_type))
+       && wi::eq_p (wi::to_wide (int_cst), wi::min_value (inner_type))))))
 
 (match max_value
- INTEGER_CST
- (if ((INTEGRAL_TYPE_P (type)
-       || POINTER_TYPE_P(type))
-      && wi::eq_p (wi::to_wide (t), wi::max_value (type)))))
+ uniform_integer_cst_p
+ (with {
+   tree int_cst = uniform_integer_cst_p (t);
+   tree itype = TREE_TYPE (int_cst);
+  }
+ (if ((INTEGRAL_TYPE_P (itype)
+       || POINTER_TYPE_P (itype))
+      && wi::eq_p (wi::to_wide (int_cst), wi::max_value (itype))))))
 
 /* x >  y  &&  x != XXX_MIN  -->  x > y
    x >  y  &&  x == XXX_MIN  -->  false . */
diff --git a/gcc/testsuite/gcc.dg/pr110915-1.c b/gcc/testsuite/gcc.dg/pr110915-1.c
new file mode 100644
index 00000000000..2e1e871b9a0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr110915-1.c
@@ -0,0 +1,31 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-ifcombine" } */
+#define vector __attribute__((vector_size(sizeof(unsigned)*2)))
+
+#include <limits.h>
+
+vector signed and1(vector unsigned x, vector unsigned y)
+{
+  /* (x > y) & (x != 0)  --> x > y */
+  return (x > y) & (x != 0);
+}
+
+vector signed and2(vector unsigned x, vector unsigned y)
+{
+  /* (x < y) & (x != UINT_MAX)  --> x < y */
+  return (x < y) & (x != UINT_MAX);
+}
+
+vector signed and3(vector signed x, vector signed y)
+{
+  /* (x > y) & (x != INT_MIN)  --> x > y */
+  return (x > y) & (x != INT_MIN);
+}
+
+vector signed and4(vector signed x, vector signed y)
+{
+  /* (x < y) & (x != INT_MAX)  --> x < y */
+  return (x < y) & (x != INT_MAX);
+}
+
+/* { dg-final { scan-tree-dump-not " != " "ifcombine" } } */
diff --git a/gcc/testsuite/gcc.dg/pr110915-10.c b/gcc/testsuite/gcc.dg/pr110915-10.c
new file mode 100644
index 00000000000..b0644bf3123
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr110915-10.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+#define vector __attribute__((vector_size(sizeof(unsigned)*2)))
+
+#include <limits.h>
+
+vector unsigned or1(vector unsigned x, vector unsigned y)
+{
+  /* (x <= y) | (x != 0))  --> true */
+  return (x <= y) | (x != 0);
+}
+
+vector unsigned or2(vector unsigned x, vector unsigned y)
+{
+  /* (x >= y) | (x != UINT_MAX)  --> true */
+  return (x >= y) | (x != UINT_MAX);
+}
+
+vector signed or3(vector signed x, vector signed y)
+{
+  /* (x <= y) | (x != INT_MIN)  --> true */
+  return (x <= y) | (x != INT_MIN);
+}
+
+vector signed or4(vector signed x, vector signed y)
+{
+  /* (x >= y) | (x != INT_MAX)  --> true */
+  return (x >= y) | (x != INT_MAX);
+}
+
+/* { dg-final { scan-tree-dump-not " != " "optimized" } } */
+/* { dg-final { scan-tree-dump-not " <= " "optimized" } } */
+/* { dg-final { scan-tree-dump-not " >= " "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/pr110915-11.c b/gcc/testsuite/gcc.dg/pr110915-11.c
new file mode 100644
index 00000000000..0288e53b16b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr110915-11.c
@@ -0,0 +1,31 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-ifcombine" } */
+#define vector __attribute__((vector_size(sizeof(unsigned)*2)))
+
+#include <limits.h>
+
+vector unsigned or1(vector unsigned x, vector unsigned y)
+{
+  /* (x <= y) | (x == 0)  --> x <= y */
+  return (x <= y) | (x == 0);
+}
+
+vector unsigned or2(vector unsigned x, vector unsigned y)
+{
+  /* (x >= y) | (x == UINT_MAX)  --> x >= y */
+  return (x >= y) | (x == UINT_MAX);
+}
+
+vector signed or3(vector signed x, vector signed y)
+{
+  /* (x <= y) | (x == INT_MIN)  --> x <= y */
+  return (x <= y) | (x == INT_MIN);
+}
+
+vector signed or4(vector signed x, vector signed y)
+{
+  /* (x >= y) | (x == INT_MAX)  --> x >= y */
+  return (x >= y) | (x == INT_MAX);
+}
+
+/* { dg-final { scan-tree-dump-not " == " "ifcombine" } } */
diff --git a/gcc/testsuite/gcc.dg/pr110915-12.c b/gcc/testsuite/gcc.dg/pr110915-12.c
new file mode 100644
index 00000000000..054a077ce3e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr110915-12.c
@@ -0,0 +1,31 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-dce3" } */
+#define vector __attribute__((vector_size(sizeof(unsigned)*2)))
+
+#include <limits.h>
+
+vector unsigned or1(vector unsigned x, vector unsigned y)
+{
+  /* (x <= y) | (x == 0)  --> x <= y */
+  return (x <= y) | (x == 0);
+}
+
+vector unsigned or2(vector unsigned x, vector unsigned y)
+{
+  /* (x >= y) | (x == UINT_MAX)  --> x >= y */
+  return (x >= y) | (x == UINT_MAX);
+}
+
+vector signed or3(vector signed x, vector signed y)
+{
+  /* (x <= y) | (x == INT_MIN)  --> x <= y */
+  return (x <= y) | (x == INT_MIN);
+}
+
+vector signed or4(vector signed x, vector signed y)
+{
+  /* (x >= y) | (x == INT_MAX)  --> x >= y */
+  return (x >= y) | (x == INT_MAX);
+}
+
+/* { dg-final { scan-tree-dump-not " == " "dce3" } } */
diff --git a/gcc/testsuite/gcc.dg/pr110915-2.c b/gcc/testsuite/gcc.dg/pr110915-2.c
new file mode 100644
index 00000000000..3962b152078
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr110915-2.c
@@ -0,0 +1,31 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+#define vector __attribute__((vector_size(sizeof(unsigned)*2)))
+
+#include <limits.h>
+
+vector signed and1(vector unsigned x, vector unsigned y)
+{
+  /* (x > y)   &   (x != 0)  --> x > y */
+  return (x > y)   &   (x != 0);
+}
+
+vector signed and2(vector unsigned x, vector unsigned y)
+{
+  /* (x < y)   &   (x != UINT_MAX)  --> x < y */
+  return (x < y)   &   (x != UINT_MAX);
+}
+
+vector signed and3(vector signed x, vector signed y)
+{
+  /* (x > y)   &   (x != INT_MIN)  --> x > y */
+  return (x > y)   &   (x != INT_MIN);
+}
+
+vector signed and4(vector signed x, vector signed y)
+{
+  /* (x < y)   &   (x != INT_MAX)  --> x < y */
+  return (x < y)   &   (x != INT_MAX);
+}
+
+/* { dg-final { scan-tree-dump-not " != " "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/pr110915-3.c b/gcc/testsuite/gcc.dg/pr110915-3.c
new file mode 100644
index 00000000000..c6462b59526
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr110915-3.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-ifcombine" } */
+#define vector __attribute__((vector_size(sizeof(unsigned)*2)))
+
+#include <limits.h>
+
+vector signed and1(vector unsigned x, vector unsigned y)
+{
+  /* (x > y)   &   (x == 0)  --> false */
+  return (x > y)   &   (x == 0);
+}
+
+vector signed and2(vector unsigned x, vector unsigned y)
+{
+  /* (x < y)   &   (x == UINT_MAX)  --> false */
+  return (x < y)   &   (x == UINT_MAX);
+}
+
+vector signed and3(vector signed x, vector signed y)
+{
+  /* (x > y)   &   (x == INT_MIN)  --> false */
+  return (x > y)   &   (x == INT_MIN);
+}
+
+vector signed and4(vector signed x, vector signed y)
+{
+  /* (x < y)   &   (x == INT_MAX)  --> false */
+  return (x < y)   &   (x == INT_MAX);
+}
+
+/* { dg-final { scan-tree-dump-not " == " "ifcombine" } } */
+/* { dg-final { scan-tree-dump-not " > " "ifcombine" } } */
+/* { dg-final { scan-tree-dump-not " < " "ifcombine" } } */
diff --git a/gcc/testsuite/gcc.dg/pr110915-4.c b/gcc/testsuite/gcc.dg/pr110915-4.c
new file mode 100644
index 00000000000..5b28ccdd321
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr110915-4.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+#define vector __attribute__((vector_size(sizeof(unsigned)*2)))
+
+#include <limits.h>
+
+vector signed and1(vector unsigned x, vector unsigned y)
+{
+  /* (x > y)   &   (x == 0)  --> false */
+  return (x > y)   &   (x == 0);
+}
+
+vector signed and2(vector unsigned x, vector unsigned y)
+{
+  /* (x < y)   &   (x == UINT_MAX)  --> false */
+  return (x < y)   &   (x == UINT_MAX);
+}
+
+vector signed and3(vector signed x, vector signed y)
+{
+  /* (x > y)   &   (x == INT_MIN)  --> false */
+  return (x > y)   &   (x == INT_MIN);
+}
+
+vector signed and4(vector signed x, vector signed y)
+{
+  /* (x < y)   &   (x == INT_MAX)  --> false */
+  return (x < y)   &   (x == INT_MAX);
+}
+
+/* { dg-final { scan-tree-dump-not " == " "optimized" } } */
+/* { dg-final { scan-tree-dump-not " > " "optimized" } } */
+/* { dg-final { scan-tree-dump-not " < " "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/pr110915-5.c b/gcc/testsuite/gcc.dg/pr110915-5.c
new file mode 100644
index 00000000000..a8b871d5bca
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr110915-5.c
@@ -0,0 +1,32 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-ifcombine" } */
+#define vector __attribute__((vector_size(sizeof(unsigned)*2)))
+
+#include <limits.h>
+
+vector signed and1(vector unsigned x, vector unsigned y)
+{
+  /* (x <= y)   &   (x == 0)  --> x == 0 */
+  return (x <= y)   &   (x == 0);
+}
+
+vector signed and2(vector unsigned x, vector unsigned y)
+{
+  /* (x >= y)   &   (x == UINT_MAX)  --> x == UINT_MAX */
+  return (x >= y)   &   (x == UINT_MAX);
+}
+
+vector signed and3(vector signed x, vector signed y)
+{
+  /* (x <= y)   &   (x == INT_MIN)  --> x == INT_MIN */
+  return (x <= y)   &   (x == INT_MIN);
+}
+
+vector signed and4(vector signed x, vector signed y)
+{
+  /* (x >= y)   &   (x == INT_MAX)  --> x == INT_MAX */
+  return (x >= y)   &   (x == INT_MAX);
+}
+
+/* { dg-final { scan-tree-dump-not " <= " "ifcombine" } } */
+/* { dg-final { scan-tree-dump-not " >= " "ifcombine" } } */
diff --git a/gcc/testsuite/gcc.dg/pr110915-6.c b/gcc/testsuite/gcc.dg/pr110915-6.c
new file mode 100644
index 00000000000..a3b9cc02a4b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr110915-6.c
@@ -0,0 +1,32 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+#define vector __attribute__((vector_size(sizeof(unsigned)*2)))
+
+#include <limits.h>
+
+vector signed and1(vector unsigned x, vector unsigned y)
+{
+  /* (x <= y)   &   (x == 0)  --> x == 0 */
+  return (x <= y)   &   (x == 0);
+}
+
+vector signed and2(vector unsigned x, vector unsigned y)
+{
+  /* (x >= y)   &   (x == UINT_MAX)  --> x == UINT_MAX */
+  return (x >= y)   &   (x == UINT_MAX);
+}
+
+vector signed and3(vector signed x, vector signed y)
+{
+  /* (x <= y)   &   (x == INT_MIN)  --> x == INT_MIN */
+  return (x <= y)   &   (x == INT_MIN);
+}
+
+vector signed and4(vector signed x, vector signed y)
+{
+  /* (x >= y)   &   (x == INT_MAX)  --> x == INT_MAX */
+  return (x >= y)   &   (x == INT_MAX);
+}
+
+/* { dg-final { scan-tree-dump-not " <= " "optimized" } } */
+/* { dg-final { scan-tree-dump-not " >= " "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/pr110915-7.c b/gcc/testsuite/gcc.dg/pr110915-7.c
new file mode 100644
index 00000000000..fd331e90e4a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr110915-7.c
@@ -0,0 +1,32 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-ifcombine" } */
+#define vector __attribute__((vector_size(sizeof(unsigned)*2)))
+
+#include <limits.h>
+
+vector signed or1(vector unsigned x, vector unsigned y)
+{
+  /* (x > y) | (x != 0)  --> x != 0 */
+  return (x > y) | (x != 0);
+}
+
+vector signed or2(vector unsigned x, vector unsigned y)
+{
+  /* (x < y) | (x != UINT_MAX)  --> x != UINT_MAX */
+  return (x < y) | (x != UINT_MAX);
+}
+
+vector signed or3(vector signed x, vector signed y)
+{
+  /* (x > y) | (x != INT_MIN)  --> x != INT_MIN */
+  return (x > y) | (x != INT_MIN);
+}
+
+vector signed or4(vector signed x, vector signed y)
+{
+  /* (x < y) | (x != INT_MAX)  --> x != INT_MAX */
+  return (x < y) | (x != INT_MAX);
+}
+
+/* { dg-final { scan-tree-dump-not " > " "ifcombine" } } */
+/* { dg-final { scan-tree-dump-not " < " "ifcombine" } } */
diff --git a/gcc/testsuite/gcc.dg/pr110915-8.c b/gcc/testsuite/gcc.dg/pr110915-8.c
new file mode 100644
index 00000000000..fae533cbf22
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr110915-8.c
@@ -0,0 +1,32 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+#define vector __attribute__((vector_size(sizeof(unsigned)*2)))
+
+#include <limits.h>
+
+vector signed or1(vector unsigned x, vector unsigned y)
+{
+  /* (x > y) | (x != 0)  --> x != 0 */
+  return (x > y) | (x != 0);
+}
+
+vector signed or2(vector unsigned x, vector unsigned y)
+{
+  /* (x < y) | (x != UINT_MAX)  --> x != UINT_MAX */
+  return (x < y) | (x != UINT_MAX);
+}
+
+vector signed or3(vector signed x, vector signed y)
+{
+  /* (x > y) | (x != INT_MIN)  --> x != INT_MIN */
+  return (x > y) | (x != INT_MIN);
+}
+
+vector signed or4(vector signed x, vector signed y)
+{
+  /* (x < y) | (x != INT_MAX)  --> x != INT_MAX */
+  return (x < y) | (x != INT_MAX);
+}
+
+/* { dg-final { scan-tree-dump-not " > " "optimized" } } */
+/* { dg-final { scan-tree-dump-not " < " "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/pr110915-9.c b/gcc/testsuite/gcc.dg/pr110915-9.c
new file mode 100644
index 00000000000..07aa08ee00b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr110915-9.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-ifcombine" } */
+#define vector __attribute__((vector_size(sizeof(unsigned)*2)))
+
+#include <limits.h>
+
+vector signed or1(vector unsigned x, vector unsigned y)
+{
+  /* (x <= y) | (x != 0)  --> true */
+  return (x <= y) | (x != 0);
+}
+
+vector signed or2(vector unsigned x, vector unsigned y)
+{
+  /* (x >= y) | (x != UINT_MAX)  --> true */
+  return (x >= y) | (x != UINT_MAX);
+}
+
+vector signed or3(vector signed x, vector signed y)
+{
+  /* (x <= y) | (x != INT_MIN)  --> true */
+  return (x <= y) | (x != INT_MIN);
+}
+
+vector signed or4(vector signed x, vector signed y)
+{
+  /* (x >= y) | (x != INT_MAX)  --> true */
+  return (x >= y) | (x != INT_MAX);
+}
+
+/* { dg-final { scan-tree-dump-not " != " "ifcombine" } } */
+/* { dg-final { scan-tree-dump-not " <= " "ifcombine" } } */
+/* { dg-final { scan-tree-dump-not " >= " "ifcombine" } } */
