Both ANDIo and ANDISo (and the 64-bit versions) are record-form instructions. When optimizing compares, we handle the former in order to eliminate the compare instruction but not the latter. This patch just adds the latter to the set of instructions we optimize.
The reason these instructions need to be handled separately is that they are not part of the RecFormRel map (since they don't have a non-record-form). The missing "and-immediate-shifted" is just an oversight in the initial implementation.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
@inouehrs Can you please review/comment/approve this as I've separated this out per your request.
Comment Actions
LGTM with nitpicking.
I feel that the current test case is somewhat fragile for minor change in inst. scheduling or register allocation.
Checking there is no cmpdi between andis. and isel may be enough.
Comment Actions
Yeah, I usually don't like to modify the checks produced by the automated tool. However, I think your suggestion is reasonable - having the andis. and no cmp before its use should sufficiently test this patch.