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

Ben Shi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 25 19:19:33 PST 2022


benshi001 added inline comments.


================
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!");
+    }
----------------
arsenm wrote:
> aykevl wrote:
> > benshi001 wrote:
> > > `"Expected a constant shift amount!"`
> > Fixed locally.
> You can't guarantee this condition. If you don't want to handle this properly, should use emitError, or at least report_fatal_error and not unreachable. This could easily be run into by users
Yes. This is problemetic. I guess the Ayke's intention is to let non-const shift amounts fall into the default ordinary process.


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

https://reviews.llvm.org/D140569



More information about the llvm-commits mailing list