[PATCH] D140569: [AVR] Custom lower 32-bit shift instructions

Ayke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 25 05:49:13 PST 2022


aykevl added a comment.

Thanks, I'll fix these things before committing.



================
Comment at: llvm/lib/Target/AVR/AVRISelLowering.cpp:291
+      // 32-bit shifts are converted to a loop in IR.
+      llvm_unreachable("Expected a constant shift!");
+    }
----------------
benshi001 wrote:
> `"Expected a constant shift amount!"`
Fixed locally.


================
Comment at: llvm/lib/Target/AVR/AVRISelLowering.cpp:1847
+    // Shift one to the left.
+    for (size_t i = 0; i < Regs.size(); i++) {
+      size_t Idx = Regs.size() - i - 1;
----------------
benshi001 wrote:
> Would it be better to be 
> ```
> for (ssize_t i = Regs.size() - 1; i >= 0; i--) {
>  ...
>  if (i == Regs.size() - 1) {
>    ...
>   } else {
>    ...
>   }
> }
> ```
Fixed locally.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140569/new/

https://reviews.llvm.org/D140569



More information about the llvm-commits mailing list