/* { dg-do compile } */
/* { dg-options "-fharden-conditional-branches -fharden-compares -fdump-tree-hardcbr -fdump-tree-hardcmp -ffat-lto-objects" } */
-int f(int i, int j) {
+int f(int i, int j, int k, int l) {
if (i == 0)
- return j != 0;
+ return (j != 0) + l;
else
- return i * j != 0;
+ return (i * j != 0) * k;
}
/* { dg-final { scan-tree-dump-times "Splitting edge" 2 "hardcbr" } } */
--- /dev/null
+/* PR tree-optimization/49959 */
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-phiopt1-details" } */
+
+#define ABS(X) (((X)>0)?(X):-(X))
+unsigned long
+test_abs(int *cur)
+{
+ unsigned long sad = 0;
+ if (cur[0] > 0)
+ sad = cur[0];
+ else
+ sad = -cur[0];
+ return sad;
+}
+
+/* We should figure out that test_abs has an ABS_EXPR in it. */
+/* { dg-final { scan-tree-dump " = ABS_EXPR" "phiopt1"} } */
+/* { dg-final { scan-tree-dump-times "changed to factor conversion out from" 1 "phiopt1"} } */
+
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-phiopt1-details" } */
+/* { dg-final { scan-tree-dump-times "changed to factor conversion out from COND_EXPR." 1 "phiopt1" } } */
+
+typedef unsigned char uint8_t;
+
+static uint8_t x264_clip_uint8 (int x)
+{
+ return x & (~255) ? (-x) >> 31 : x;
+}
+
+void
+mc_weight (uint8_t* __restrict dst, uint8_t* __restrict src,
+ int i_width,int i_scale)
+{
+ for(int x = 0; x < i_width; x++)
+ dst[x] = x264_clip_uint8 (src[x] * i_scale);
+}
gphi *newphi;
if (single_pred_p (bb1)
- && !diamond_p
+ && EDGE_COUNT (merge->preds) == 2
&& (newphi = factor_out_conditional_conversion (e1, e2, phi,
arg0, arg1,
cond_stmt)))