[PATCH] D98335: [AVR] Refactor 8-bit & 16-bit shifts
Ben Shi via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 10 06:29:17 PST 2021
benshi001 added a comment.
As shown in test case https://github.com/llvm/llvm-project/blob/main/llvm/test/CodeGen/AVR/shift.ll,
this patch generates optimized code for most cases as avr-gcc does (though there are slight differences in instrution sequence).
TODO:
1. futher optimization for 8-bit `ashr x, 6`
2. remove the redundant `lsl <lower byte>` in 16-bit shl when shiftAmount>8;
3. remove the redundant `lsr <higher byte>` in 16-bit lshr when shiftAmount>8;
4. remove the redundant `asr <higher byte>` in 16-bit ashr when shiftAmount>8;
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D98335/new/
https://reviews.llvm.org/D98335
More information about the llvm-commits
mailing list