Skip to content

Commit ba22c40

Browse files
committed
[Inliner][NPM] Properly pass callee AAResults
Fixes noalias-calls.ll under NPM. Differential Revision: https://reviews.llvm.org/D89592
1 parent 245d71b commit ba22c40

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

llvm/lib/Transforms/IPO/Inliner.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,8 @@ PreservedAnalyses InlinerPass::run(LazyCallGraph::SCC &InitialC,
854854
&FAM.getResult<BlockFrequencyAnalysis>(*(CB->getCaller())),
855855
&FAM.getResult<BlockFrequencyAnalysis>(Callee));
856856

857-
InlineResult IR = InlineFunction(*CB, IFI);
857+
InlineResult IR =
858+
InlineFunction(*CB, IFI, &FAM.getResult<AAManager>(*CB->getCaller()));
858859
if (!IR.isSuccess()) {
859860
Advice->recordUnsuccessfulInlining(IR);
860861
continue;

llvm/test/Transforms/Inline/noalias-calls.ll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature
22
; RUN: opt -basic-aa -inline -enable-noalias-to-md-conversion -S < %s | FileCheck %s
3+
; RUN: opt -aa-pipeline=basic-aa -passes=inline -enable-noalias-to-md-conversion -S < %s | FileCheck %s
34
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
45
target triple = "x86_64-unknown-linux-gnu"
56

0 commit comments

Comments
 (0)