[PATCH] D96677: [AVR] Expand large shifts early in IR

Ayke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 21 09:21:34 PST 2021


aykevl added a comment.

In D96677#2577490 <https://reviews.llvm.org/D96677#2577490>, @benshi001 wrote:

> I am not sure such a specific pass is needed. Why `__ashlsi3` is not called in other backends? Is there a config flag/option to prevent calling `__ashlsi3` ?

Because most instruction sets do support 32-bit shifts but AVR does not. For example, it appears that the MSP430 has the same problem: https://reviews.llvm.org/D78663#2215170.

I've investigated whether there are any other options to this but I couldn't come up with any. The builtin calls are created inside SelectionDAG which converts non-constant shifts to library calls. Therefore, this pass converts non-constant shifts to constant shifts in a loop to match avr-gcc so that the resulting code does not contain any 32-bit non-constant shifts.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96677



More information about the llvm-commits mailing list