[InstSimplify] Don't simplify musttail calls
authorNikita Popov <nikita.ppv@gmail.com>
Sun, 8 Mar 2020 12:11:46 +0000 (13:11 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 9 Mar 2020 17:46:56 +0000 (18:46 +0100)
commit829d377a98fd3ee087935ea215677e49c8b51b27
treebcdc0755696274441a732d86638afa62f41aaf40
parent843a9778fcd5ef93804fc22de04af9ab8c8b20a9
[InstSimplify] Don't simplify musttail calls

As pointed out by jdoerfert on D75815, we must be careful when
simplifying musttail calls: We can only replace the return value
if we can eliminate the call entirely. As we can't make this
guarantee for all consumers of InstSimplify, this patch disables
simplification of musttail calls. Without this patch, musttail
simplification currently results in module verification errors.

Differential Revision: https://reviews.llvm.org/D75824
llvm/lib/Analysis/InstructionSimplify.cpp
llvm/test/Transforms/InstSimplify/call.ll