OSDN Git Service

Re-commit r357452 (take 2): "SimplifyCFG SinkCommonCodeFromPredecessors: Also sink...
authorHans Wennborg <hans@hanshq.net>
Tue, 28 May 2019 12:19:38 +0000 (12:19 +0000)
committerHans Wennborg <hans@hanshq.net>
Tue, 28 May 2019 12:19:38 +0000 (12:19 +0000)
commitafeb42acc3c4295cc6d85e93e129e8f46f306a22
tree2690979b19d3a9d62534391974f3c19238df9142
parentb925fef78c37d7e925550a43f3a5dc50d19b2bcd
Re-commit r357452 (take 2): "SimplifyCFG SinkCommonCodeFromPredecessors: Also sink function calls without used results (PR41259)"

This was reverted in r360086 as it was supected of causing mysterious test
failures internally. However, it was never concluded that this patch was the
root cause.

> The code was previously checking that candidates for sinking had exactly
> one use or were a store instruction (which can't have uses). This meant
> we could sink call instructions only if they had a use.
>
> That limitation seemed a bit arbitrary, so this patch changes it to
> "instruction has zero or one use" which seems more natural and removes
> the need to special-case stores.
>
> Differential revision: https://reviews.llvm.org/D59936

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361811 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/SimplifyCFG.cpp
test/CodeGen/AArch64/max-jump-table.ll
test/CodeGen/AArch64/min-jump-table.ll
test/CodeGen/AArch64/win64-jumptable.ll
test/CodeGen/ARM/cmpxchg-idioms.ll
test/Transforms/SimplifyCFG/sink-common-code.ll