GICombiner and tree matcher


I tried to create a combiner using the tree matcher, like in the test case.
However, this fails with the assertion message “Declared variable twice”. To reproduce, you can simply remove the -gicombiner-stop-after-build option in the test case. Then already the first rule crashes with this assertion.

Any ideas how to make this work? From first look it seems the problem is that every time a variable is used, a possible code expansion is added. This obviously does not work with the variable connecting the rules, like $t in

  (match (MUL $t, $s1, $s2),
         (SUB $d, $t, $s3)),



I found some more issues with the tree matcher which I try to fix in D133257.

1 Like