Add some AArch64 dag combines to optimize some simple TBZ/TBNZ cases:
(tbz (and x, m), b) -> (tbz x, b)
(tbz (shl x, c), b) -> (tbz x, b-c)
(tbz (shr x, c), b) -> (tbz x, b+c)
(tbz (xor x, -1), b) -> (tbnz x, b)
Differential D15702
[AArch64] Optimize some simple TBZ/TBNZ cases. gberry on Dec 21 2015, 1:57 PM. Authored by
Details Add some AArch64 dag combines to optimize some simple TBZ/TBNZ cases: (tbz (and x, m), b) -> (tbz x, b)
Diff Detail
Event TimelineComment Actions Hi Geoff, looks good. :-) I have some potentially silly questions inline, just curiosities.
Comment Actions Chad, Charlie, Thanks for the review. I believe I have addressed all of your concerns. Charlie, as to your question about folding opportunities, I don't think those should occur (they should have already been optimized). I did a test run to detect if any of these cases show up and was unable to find a single occurrence. I did however hit a few instances of a missing case of a tbz of an ashr that was essentially testing the carried-in sign bit (see the test case test18 for an example). I added some new code to handle that case in the latest version of the change. |