[PATCH] D153197: [AVR] Expand shifts during AVRISelLowering

Patryk Wychowaniec via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Jun 17 04:30:45 PDT 2023


Patryk27 created this revision.
Herald added subscribers: Jim, JDevlieghere, hiraditya, dylanmckay.
Herald added a project: All.
Patryk27 requested review of this revision.
Herald added projects: clang, LLVM.
Herald added subscribers: llvm-commits, cfe-commits.

Some passes can introduce shifts after AVRShiftExpandPass has completed;
if this happens, we panic during isel because we assume such shifts must
have been already expanded before.

This commit integrates our shift-expansion pass with isel-selection pass
so that isel doesn't get surprised by shifts of non-constant amounts
anymore.

Spotted in the wild in rustc:

- https://github.com/rust-lang/compiler-builtins/issues/523
- https://github.com/rust-lang/rust/issues/112140


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D153197

Files:
  clang/docs/tools/clang-formatted-files.txt
  llvm/lib/Target/AVR/AVR.h
  llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp
  llvm/lib/Target/AVR/AVRISelLowering.cpp
  llvm/lib/Target/AVR/AVRShiftExpand.cpp
  llvm/lib/Target/AVR/AVRTargetMachine.cpp
  llvm/lib/Target/AVR/CMakeLists.txt
  llvm/test/CodeGen/AVR/shift-expand.ll
  llvm/test/CodeGen/AVR/shift-loop.ll
  llvm/test/CodeGen/AVR/shift32.ll
  llvm/utils/gn/secondary/llvm/lib/Target/AVR/BUILD.gn

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153197.532386.patch
Type: text/x-patch
Size: 34467 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230617/3a4b0245/attachment-0001.bin>


More information about the cfe-commits mailing list