[Inline] Introduce Constant::hasOneLiveUse, use it instead of hasOneUse in inline...
authorErik Desjardins <erikdesjardinspublic@gmail.com>
Thu, 7 Oct 2021 15:14:56 +0000 (08:14 -0700)
committerMircea Trofin <mtrofin@google.com>
Thu, 7 Oct 2021 15:33:25 +0000 (08:33 -0700)
commit11c8efd4db0fe58a2858459353cc5c0c41565ee5
tree4e49db7776b879ecfea37b9035d5101b2da60f42
parent3a5aa57c9b1c01c990700bfcedcebc14ef9a97dc
[Inline] Introduce Constant::hasOneLiveUse, use it instead of hasOneUse in inline cost model (PR51667)

Otherwise, inlining costs may be pessimized by dead constants.

Fixes https://bugs.llvm.org/show_bug.cgi?id=51667.

Reviewed By: mtrofin, aeubanks

Differential Revision: https://reviews.llvm.org/D109294
llvm/include/llvm/IR/Constant.h
llvm/lib/Analysis/InlineCost.cpp
llvm/lib/IR/Constants.cpp
llvm/test/Transforms/Inline/inline-cost-dead-users.ll [new file with mode: 0644]
llvm/test/Transforms/Inline/last-callsite.ll