bool checkForAllCallSites(function_ref<bool(AbstractCallSite)> Pred,
const Function &Fn, bool RequireAllCallSites,
const AbstractAttribute *QueryingAA,
- bool &UsedAssumedInformation);
+ bool &UsedAssumedInformation,
+ bool CheckPotentiallyDead = false);
/// Check \p Pred on all values potentially returned by \p F.
///
const Function &Fn,
bool RequireAllCallSites,
const AbstractAttribute *QueryingAA,
- bool &UsedAssumedInformation) {
+ bool &UsedAssumedInformation,
+ bool CheckPotentiallyDead) {
if (RequireAllCallSites && !Fn.hasLocalLinkage()) {
LLVM_DEBUG(
dbgs()
dbgs() << "[Attributor] Check use: " << *U << " in " << *U.getUser()
<< "\n";
});
- if (isAssumedDead(U, QueryingAA, nullptr, UsedAssumedInformation,
+ if (!CheckPotentiallyDead &&
+ isAssumedDead(U, QueryingAA, nullptr, UsedAssumedInformation,
/* CheckBBLivenessOnly */ true)) {
DEBUG_WITH_TYPE(VERBOSE_DEBUG_TYPE,
dbgs() << "[Attributor] Dead use, skip!\n");
// Use the CallSiteReplacementCreator to create replacement call sites.
bool UsedAssumedInformation = false;
bool Success = checkForAllCallSites(CallSiteReplacementCreator, *OldFn,
- true, nullptr, UsedAssumedInformation);
+ true, nullptr, UsedAssumedInformation,
+ /* CheckPotentiallyDead */ true);
(void)Success;
assert(Success && "Assumed call site replacement to succeed!");
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals
; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=2 -S < %s | FileCheck %s --check-prefixes=CHECK,TUNIT
-; opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC
+; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC
define internal void @dead() {
; CGSCC-LABEL: define {{[^@]+}}@dead() {
-; CGSCC-NEXT: [[TMP1:%.*]] = call i32 poison(ptr null, ptr null)
+; CGSCC-NEXT: [[TMP1:%.*]] = call i32 @test()
; CGSCC-NEXT: ret void
;
call i32 @test(ptr null, ptr null)
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals
; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=2 -S < %s | FileCheck %s --check-prefixes=CHECK,TUNIT
-; opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC
+; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC
define internal void @dead() {
; CGSCC-LABEL: define {{[^@]+}}@dead() {
-; CGSCC-NEXT: [[TMP1:%.*]] = call i32 poison(ptr null, ptr null)
+; CGSCC-NEXT: [[TMP1:%.*]] = call i32 @test(ptr null)
; CGSCC-NEXT: ret void
;
call i32 @test(ptr null, ptr null)
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals
; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=6 -S < %s | FileCheck %s --check-prefixes=CHECK,TUNIT
-; opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC
+; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
; CGSCC-NEXT: [[TMP2:%.*]] = icmp eq ptr [[TMP0]], null
; CGSCC-NEXT: br i1 [[TMP2]], label [[TMP5:%.*]], label [[TMP3:%.*]]
; CGSCC: 3:
-; CGSCC-NEXT: [[TMP4:%.*]] = tail call ptr poison(ptr nonnull [[TMP0]])
+; CGSCC-NEXT: [[TMP4:%.*]] = tail call ptr @f1b()
; CGSCC-NEXT: br label [[TMP7:%.*]]
; CGSCC: 5:
; CGSCC-NEXT: [[TMP6:%.*]] = tail call ptr @f3b()