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)
commitb669fea42f5c2a5b203c3f0da2a6b04b90bfd5a7
tree93e860ceb5b6e8630fcfe4a7bde94992c95cc72c
parent155bc16e7f5a96bcce5a7c30eec49d60098c1c92
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

llvm-svn: 357452
clang/test/CodeGenCXX/nrvo.cpp
clang/test/CodeGenCXX/stack-reuse-exceptions.cpp
clang/test/CodeGenObjC/exceptions.m
llvm/lib/Transforms/Utils/SimplifyCFG.cpp
llvm/test/CodeGen/AArch64/max-jump-table.ll
llvm/test/CodeGen/AArch64/min-jump-table.ll
llvm/test/CodeGen/AArch64/win64-jumptable.ll
llvm/test/CodeGen/ARM/cmpxchg-idioms.ll
llvm/test/Transforms/SimplifyCFG/sink-common-code.ll