This was first raised in https://reviews.llvm.org/D81353#2078725.
We solved many bugs related to PowerPC generating CTR Loops too early and after ISEL we found there is CTR clobber in the CTR loop. So we have to exclude the CTR clobber instructions in hardware loop insertion pass one by one.
This patch implements a new way to generate the CTR loops. Now the intrinsics inserted in hardware loop pass will be mapped to pseudo instructions and these pseudo instructions will be expanded to CTR loop or normal compare+branch loop based on the result of a new added post-isel pass PPCCTRLoop.
This is the first part, including:
1: pseudo instructions for the CTR loops.
2: a new pass to expand the pseudo instructions.
One or more follow up patches will map the hardware loop intrinsics to the new added pseudo instructions and delete the CTR clobber check in hardware loop insertion pass.
Do we have to add stats to count how many loops transformed?