OSDN Git Service

[IPSCCP] do not break musttail invariant (PR36485)
authorReid Kleckner <rnk@google.com>
Thu, 1 Mar 2018 01:19:18 +0000 (01:19 +0000)
committerReid Kleckner <rnk@google.com>
Thu, 1 Mar 2018 01:19:18 +0000 (01:19 +0000)
commitbb55f795cb9b3d7cca45a30faed1a27026f45e0f
treea20cc20fdf91ec939a4353f5b727f053f443dfc5
parent4bd2f44130d2aa92d550b04db2c14942538ec3bf
[IPSCCP] do not break musttail invariant (PR36485)

Do not replace results of `musttail` calls with a constant if the
call itself can't be removed.

Do not zap returns of `musttail` callees, if the call site can't be
removed and replaced with a constant.

Do not zap returns of `musttail`-calling blocks, this breaks
invariant too.

Patch by Fedor Indutny

Differential Revision: https://reviews.llvm.org/D43695

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326404 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/SCCP.cpp
test/Transforms/IPConstantProp/musttail-call.ll [new file with mode: 0644]