@@ -417,17 +417,18 @@ Generally, we prefer unsigned operations over signed operations in the middle-en
417417if signed operations are more efficient on some targets. The following is an incomplete
418418list of canonicalizations that implemented in InstCombine:
419419
420- | Original Pattern | Canonical Form | Condition |
421- | ------------------------------| --------------------| -------------------------------|
422- | ` icmp spred X, Y ` | ` icmp upred X, Y ` | ` sign(X) == sign(Y) ` |
423- | ` smin/smax X, Y ` | ` umin/umax X, Y ` | ` sign(X) == sign(Y) ` |
424- | ` sext X ` | ` zext nneg X ` | ` X >=s 0 ` |
425- | ` sitofp X ` | ` uitofp nneg X ` | ` X >=s 0 ` |
426- | ` ashr X, Y ` | ` lshr X, Y ` | ` X >=s 0 ` |
427- | ` add X, Y ` | ` or disjoint X, Y ` | ` (X & Y) != 0 ` |
428- | ` mul X, C ` | ` shl X, Log2(C) ` | ` isPowerOf2(C) ` |
429- | ` select Cond1, Cond2, false ` | ` and Cond1, Cond2 ` | ` impliesPoison(Cond2, Cond1) ` |
430- | ` select Cond1, true, Cond2 ` | ` or Cond1, Cond2 ` | ` impliesPoison(Cond2, Cond1) ` |
420+ | Original Pattern | Canonical Form | Condition |
421+ | ------------------------------| ----------------------------| -------------------------------|
422+ | ` icmp spred X, Y ` | ` icmp samesign upred X, Y ` | ` sign(X) == sign(Y) ` |
423+ | ` smin/smax X, Y ` | ` umin/umax X, Y ` | ` sign(X) == sign(Y) ` |
424+ | ` sext X ` | ` zext nneg X ` | ` X >=s 0 ` |
425+ | ` sitofp X ` | ` uitofp nneg X ` | ` X >=s 0 ` |
426+ | ` ashr X, Y ` | ` lshr X, Y ` | ` X >=s 0 ` |
427+ | ` sdiv/srem X, Y ` | ` udiv/urem X, Y ` | ` X >=s 0 && Y >=s 0 ` |
428+ | ` add X, Y ` | ` or disjoint X, Y ` | ` (X & Y) != 0 ` |
429+ | ` mul X, C ` | ` shl X, Log2(C) ` | ` isPowerOf2(C) ` |
430+ | ` select Cond1, Cond2, false ` | ` and Cond1, Cond2 ` | ` impliesPoison(Cond2, Cond1) ` |
431+ | ` select Cond1, true, Cond2 ` | ` or Cond1, Cond2 ` | ` impliesPoison(Cond2, Cond1) ` |
431432
432433### PatternMatch
433434
0 commit comments