[PATCH] D38738: X86CallFrameOptimization: Recognize 'store 0/-1 using and/or' idioms

Zvi Rackover via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 10 08:17:06 PDT 2017


zvi created this revision.

r264440 added or/and patterns for storing -1 or 0 with the intention of decreasing code size. However,
X86CallFrameOptimization does not recognize these memory accesses so it will not replace them with push's when profitable.

This patches fixes this problem by teaching X86CallFrameOptimization these store 0/-1 idioms.

An alternative fix would be to prevent the 'store 0/1 idioms' patterns from firing when accessing the stack. This would save
the need to teach the pass about these idioms. However, because X86CallFrameOptimization does not always fire we may result
in cases where neither X86CallFrameOptimization not the patterns for 'store 0/1 idioms' fire.

Fixes pr34863


https://reviews.llvm.org/D38738

Files:
  lib/Target/X86/X86CallFrameOptimization.cpp
  test/CodeGen/X86/memcmp-minsize.ll
  test/CodeGen/X86/movtopush.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38738.118398.patch
Type: text/x-patch
Size: 23121 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171010/fb22937e/attachment.bin>


More information about the llvm-commits mailing list