This patch depends on D89855. We have patterns to fold RLWINM + RLWINM.
Pairs of RLWINM and ANDI_rec can also be folded in some cases.
Following is a scenario in C code:
int tmp = vec_test_swdiv(x,y); if (((__builtin_rotateleft32(tmp, 62)) & (1)) != 0){ ... }
clang -c t.c -O3 generates the sequence:
xvtdivdp cr0,vs34,vs35 mfocrf r3,128 rlwinm r3,r3,4,28,31 --->generated in POST-RA andi. r3,r3,4
This patch will fold it to:
xvtdivdp cr0,vs34,vs35 mfocrf r3,128 rlwinm. r3,r3,4,29,29
clang-format: please reformat the code