[PATCH] D28307: Add Instruction number to LSR cost model (PR23384) part 1 of 3

Evgeny Stupachenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 25 16:18:15 PST 2017


evstupac updated this revision to Diff 85832.
evstupac added a reviewer: hfinkel.
evstupac added a comment.

Updated test according to the latest comments.
For lsr-insns-1.ll the most important is to check that there are no "cmp" in the loop.
For lsr-insns-2.ll it is important that calculations are moved to address mode. However several variants are ok:

  movl    (%rsi,%rcx,4), %eax
  ...
  incq %rax
  cmpq %rcx, %r8

or

  movl    (%rsi,%rcx), %eax
  ...
  addq $4, %rax
  cmpq %rcx, %r8

"cmpq %rcx, %r8" could also be replaced with "decq %r8".
So I simplified checks to avoid fails in case of the replacements above.


Repository:
  rL LLVM

https://reviews.llvm.org/D28307

Files:
  lib/Transforms/Scalar/LoopStrengthReduce.cpp
  test/Transforms/LoopStrengthReduce/X86/lsr-insns-1.ll
  test/Transforms/LoopStrengthReduce/X86/lsr-insns-2.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28307.85832.patch
Type: text/x-patch
Size: 8746 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170126/c1910127/attachment.bin>


More information about the llvm-commits mailing list