[PATCH] D147704: [Inliner] Preserve nonnull from callsites during inlining
Arthur Eubanks (out until mid-April) via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 12 21:14:16 PDT 2023
aeubanks added a comment.
what's the compile time impact of this?
================
Comment at: llvm/lib/Transforms/Utils/InlineFunction.cpp:1475
+ auto *ArgVal = CB.getArgOperand(ArgNo);
+ if (CB.getAttributes().hasParamAttr(ArgNo, Attribute::NonNull) && !isKnownNonZero(ArgVal, DL, 0, AC)) {
+ CallInst *NewAsmp = Builder.CreateNonNullAssumption(CB.getArgOperand(ArgNo));
----------------
are there tests for `isKnownNonZero`?
================
Comment at: llvm/test/Transforms/Inline/assumptions-from-callsite-attrs.ll:3
; RUN: opt -S -passes=inline %s | FileCheck %s
; RUN: opt -S -passes='cgscc(inline)' %s | FileCheck %s
; RUN: opt -S -passes='module-inline' %s | FileCheck %s
----------------
redundant RUN line
================
Comment at: llvm/test/Transforms/Inline/assumptions-from-callsite-attrs.ll:4
; RUN: opt -S -passes='cgscc(inline)' %s | FileCheck %s
; RUN: opt -S -passes='module-inline' %s | FileCheck %s
----------------
I wouldn't worry about the module inliner, it's still experimental
================
Comment at: llvm/test/Transforms/PhaseOrdering/dae-dce.ll:22
+; LTO-LABEL: @capture_and_trap(
+; LTO-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(ptr poison) ]
+; LTO-NEXT: tail call void @llvm.trap()
----------------
isn't this now UB?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D147704/new/
https://reviews.llvm.org/D147704
More information about the llvm-commits
mailing list