[CallPromotionUtils] Add missing promotion legality check to tryPromoteCall.
authorHiroshi Yamauchi <yamauchi@google.com>
Thu, 27 Feb 2020 21:59:59 +0000 (13:59 -0800)
committerHiroshi Yamauchi <yamauchi@google.com>
Fri, 28 Feb 2020 17:35:09 +0000 (09:35 -0800)
commit41e06ae7ba911661962c9f190ae88d1f29c076da
tree603ddfcdb7f8af65fc42a820df7be9a9f869f764
parent02e5e47e170c132f8c109ae994cdd5f6029e4b36
[CallPromotionUtils] Add missing promotion legality check to tryPromoteCall.

Summary: This fixes the crash that led to the revert of D69591.

Reviewers: davidxl

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D75307
llvm/lib/Transforms/Utils/CallPromotionUtils.cpp
llvm/unittests/Transforms/Utils/CallPromotionUtilsTest.cpp