[PATCH] D140917: [AVR] Optimize away cpi instructions when possible

Ayke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 3 12:35:14 PST 2023


aykevl created this revision.
aykevl added reviewers: dylanmckay, benshi001.
Herald added subscribers: Jim, hiraditya.
Herald added a project: All.
aykevl requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

In many cases, the `cpi` instruction can be skipped because a previous instruction already sets the needed flags.

This saves around 1% in binary size.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D140917

Files:
  llvm/lib/Target/AVR/AVRInstrInfo.cpp
  llvm/lib/Target/AVR/AVRInstrInfo.h
  llvm/lib/Target/AVR/AVRInstrInfo.td
  llvm/test/CodeGen/AVR/fold-cmp.ll
  llvm/test/CodeGen/AVR/fold-cmp.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D140917.486051.patch
Type: text/x-patch
Size: 11487 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230103/e6efde57/attachment.bin>


More information about the llvm-commits mailing list