2 * This test case shows that it's not possible to find a PBQP solution for
3 * arbitrary pattern sets.
5 * To get infinity costs you have to remove the following Lea rules:
6 * - Add(Shl(ShiftConst(), index=IR_node()), imm=Const())
7 * - Add(Shl(ShiftConst(), index=IR_node()), base=IR_node())
9 * You also have to use the following compiler flags:
10 * -O3 -fno-reassociation
12 * For more details take a look at the diamond function.
16 unsigned *gi1, gi2, gi3, gi4, gi5;
17 unsigned *gi101, gi102, gi103, gi104, gi105;
18 unsigned *gi201, gi202, gi203, gi204, gi205;
19 unsigned *gi211, gi212, gi213, gi214, gi215;
20 unsigned *gi301, gi302, gi303, gi304, gi305;
21 unsigned *gi311, gi312, gi313, gi314, gi315;
22 unsigned *gi401, gi402, gi403, gi404, gi405;
23 unsigned *gi411, gi412, gi413, gi414, gi415;
24 unsigned *gi501, gi502, gi503, gi504, gi505;
25 unsigned *gi511, gi512, gi513, gi514, gi515;
26 unsigned *gi601, gi602, gi603, gi604, gi605;
27 unsigned *gi611, gi612, gi613, gi614, gi615;
28 unsigned *gi701, gi702, gi703, gi704, gi705;
29 unsigned *gi711, gi712, gi713, gi714, gi715;
30 unsigned *gi801, gi802, gi803, gi804, gi805;
31 unsigned *gi811, gi812, gi813, gi814, gi815;
35 int main(int argc, char **argv)
40 unsigned add_1_shift_users(unsigned i1, unsigned i2, unsigned i3,
41 char *k1, char *k2, char *k3,
42 unsigned **gp1, unsigned **gp2, unsigned **gp3, unsigned **gp4,
43 unsigned **gp5, unsigned **gp6, unsigned **gp7, unsigned **gp8,
45 const int c1, const int c2, const int c3)
47 unsigned tmp1 = i1 + c1;
48 unsigned tmp2 = (i2 << 3) + c2;
49 unsigned tmp3 = (i3 << 3) + c3;
66 unsigned add_3_add_const_shift_users(unsigned i1, unsigned i2, unsigned i3,
67 char *k1, char *k2, char *k3,
68 unsigned **gp1, unsigned **gp2, unsigned **gp3, unsigned **gp4,
69 unsigned **gp5, unsigned **gp6, unsigned **gp7, unsigned **gp8,
71 const int c1, const int c2)
73 unsigned tmp2 = (i2 << 3) + c1;
74 unsigned tmp3 = (i3 << 3) + c2;
94 * This is the basic structure.
102 * The basic idea is to make a heuristical "consume me" decision for "as".
103 * If "asb" and "asc" have no terminal rules which consumes "as", they also
104 * have to be consumed. Therefore "sum" has to consume both paths up to
105 * "as", which isn't possible.
107 unsigned as = a << 3;
108 unsigned asb = as + 123235;
109 unsigned asc = as + 235346;
110 unsigned sum = asb + asc;
114 /* Add 3 users for asb. */
115 use = add_3_add_const_shift_users(asb, gi1, gi2,
117 &gp[0], &gp[1], &gp[2], &gp[3], &gp[4], &gp[5], &gp[6], &gp[7], &gp[8],
120 /* Add 3 users for asc. */
121 use = add_3_add_const_shift_users(asc, gi101, gi102,
122 &gi103, &gi104, &gi105,
123 &gp[100], &gp[101], &gp[102], &gp[103], &gp[104], &gp[105], &gp[106], &gp[107], &gp[108],
126 /* Add 4 users for as. */
127 use = add_1_shift_users(as, gi201, gi202,
128 &gi203, &gi204, &gi205,
129 &gp[200], &gp[201], &gp[202], &gp[203], &gp[204], &gp[205], &gp[206], &gp[207], &gp[208],
131 use = add_1_shift_users(as, gi301, gi302,
132 &gi303, &gi304, &gi305,
133 &gp[300], &gp[301], &gp[302], &gp[303], &gp[304], &gp[305], &gp[306], &gp[307], &gp[308],
135 use = add_1_shift_users(as, gi401, gi402,
136 &gi403, &gi404, &gi405,
137 &gp[400], &gp[401], &gp[402], &gp[403], &gp[404], &gp[405], &gp[406], &gp[407], &gp[408],
139 use = add_1_shift_users(as, gi501, gi502,
140 &gi503, &gi504, &gi505,
141 &gp[500], &gp[501], &gp[502], &gp[503], &gp[504], &gp[505], &gp[506], &gp[507], &gp[508],