]> granicus.if.org Git - llvm/commit
SimplifyCFG SinkCommonCodeFromPredecessors: Also sink function calls without used...
authorHans Wennborg <hans@hanshq.net>
Tue, 2 Apr 2019 08:01:38 +0000 (08:01 +0000)
committerHans Wennborg <hans@hanshq.net>
Tue, 2 Apr 2019 08:01:38 +0000 (08:01 +0000)
commit8abcd764922816e9234d2bff5b210fa0dd1b7d11
tree8d0f509b1b679dd84328a9688ffcff89c7204a42
parent2f2c88671c4bd9398ac9adeeb1c8ed65034948a5
SimplifyCFG SinkCommonCodeFromPredecessors: Also sink function calls without used results (PR41259)

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@357452 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