[PATCH] D37198: [InlineCost] add visitSelectInst()

Haicheng Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 27 11:48:37 PDT 2017


haicheng created this revision.
Herald added a subscriber: javed.absar.

This patch adds visitSelectInst() to find free Select IRs and continue the propagation of SimplifiedValues, ConstantOffsetPtrs, and SROAArgValues.

We don't need all operands of Select IR to be constants to fold it, so I don't use the generic CallAnalyzer::simplifyInstruction().

The impact on SPEC20xx is below

| Benchmark          | Code Size (%) | Perf (%)      |
|                    | (+ is bigger) | (+ is faster) |
| spec2000/gcc       | 0.01          | 1.08          |
| spec2000/mesa      | 0.04          | 2.2           |
| spec2000/twolf     | -0.15         | -0.01         |
| spec2006/gcc       | 0.02          | -0.19         |
| spec2006/h264ref   | 0.33          | 0.18          |
| spec2017/blender   | 0.01          | 0.5           |
| spec2017/gcc       | 0.01          | 0.09          |
| spec2017/imagick   | 0.02          | 0.01          |
| spec2017/parest    | 0             | -0.05         |
| spec2017/perlbench | 0.1           | 0.56          |


Repository:
  rL LLVM

https://reviews.llvm.org/D37198

Files:
  lib/Analysis/InlineCost.cpp
  test/Transforms/Inline/AArch64/select.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37198.112834.patch
Type: text/x-patch
Size: 9652 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170827/40a8f2cf/attachment-0001.bin>


More information about the llvm-commits mailing list