[PATCH] D18374: [X86] Use "and $0" and "orl $-1" to store 0 and -1 when optimizing for minsize

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 22 13:35:29 PDT 2016


hans created this revision.
hans added reviewers: DavidKreitzer, zansari.
hans added subscribers: llvm-commits, joerg.

64-bit, 32-bit and 16-bit move-immediate instructions are 7, 6, and 5 bytes, respectively, whereas 8-bit and/or is only three bytes.

Since these instructions imply an additional memory read (which the CPU could elide, but we don't think it does), restrict these patterns to minsize functions.

http://reviews.llvm.org/D18374

Files:
  lib/Target/X86/X86ISelDAGToDAG.cpp
  lib/Target/X86/X86InstrCompiler.td
  lib/Target/X86/X86InstrInfo.td
  test/CodeGen/X86/store-zero.ll
  test/CodeGen/X86/tail-opts.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18374.51333.patch
Type: text/x-patch
Size: 5152 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160322/5964ec4f/attachment.bin>


More information about the llvm-commits mailing list