[PATCH] D104958: [Test] rewrite inline_nossp.ll

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 29 14:44:11 PDT 2021


nickdesaulniers added inline comments.


================
Comment at: llvm/test/Transforms/Inline/inline_nossp.ll:20
 ; CHECK-LABEL: @nossp_caller(
-; CHECK-NEXT:    [[TMP1:%.*]] = alloca i64, align 8
-; CHECK-NEXT:    [[SAVEDSTACK:%.*]] = call i8* @llvm.stacksave()
-; CHECK-NEXT:    call void @ssp(i64 1024)
-; CHECK-NEXT:    [[SAVEDSTACK_I:%.*]] = call i8* @llvm.stacksave()
-; CHECK-NEXT:    [[TMP2:%.*]] = bitcast i64* [[TMP1]] to i8*
-; CHECK-NEXT:    call void @llvm.lifetime.start.p0i8(i64 8, i8* [[TMP2]])
-; CHECK-NEXT:    store i64 1024, i64* [[TMP1]], align 8
-; CHECK-NEXT:    [[TMP3:%.*]] = load i64, i64* [[TMP1]], align 8
-; CHECK-NEXT:    [[TMP4:%.*]] = alloca i8, i64 [[TMP3]], align 16
-; CHECK-NEXT:    call void @foo(i8* [[TMP4]])
-; CHECK-NEXT:    [[TMP5:%.*]] = bitcast i64* [[TMP1]] to i8*
-; CHECK-NEXT:    call void @llvm.lifetime.end.p0i8(i64 8, i8* [[TMP5]])
-; CHECK-NEXT:    call void @llvm.stackrestore(i8* [[SAVEDSTACK_I]])
-; CHECK-NEXT:    call void @llvm.stackrestore(i8* [[SAVEDSTACK]])
-; CHECK-NEXT:    ret void
+; CHECK-NEXT:    [[TMP1:%.*]] = call i32 @ssp()
+; CHECK-NEXT:    ret i32 44
----------------
aeubanks wrote:
> nickdesaulniers wrote:
> > abhinavgaba wrote:
> > > Looks like this fails with the legacy pass manager. Could you please add `-enable-new-pm=1` if this is intended to be limited to the new pass manager?
> > > 
> > > ```
> > > diff --git a/llvm/test/Transforms/Inline/inline_nossp.ll b/llvm/test/Transforms/Inline/inline_nossp.ll
> > > index 2a4c8c65f892..54b1ba97be8c 100644
> > > --- a/llvm/test/Transforms/Inline/inline_nossp.ll
> > > +++ b/llvm/test/Transforms/Inline/inline_nossp.ll
> > > @@ -1,5 +1,5 @@
> > >  ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
> > > -; RUN: opt -inline -o - -S %s -pass-remarks-missed=inline 2>&1 | FileCheck --check-prefixes=CHECK,CHECK-INLINE %s
> > > +; RUN: opt -inline -enable-new-pm=1 -o - -S %s -pass-remarks-missed=inline 2>&1 | FileCheck --check-prefixes=CHECK,CHECK-INLINE %s
> > >  ; RUN: opt -passes='cgscc(inline)' %s -S -pass-remarks-missed=inline 2>&1 | FileCheck --check-prefixes=CHECK,CHECK-INLINE %s
> > >  ; RUN: opt -always-inline -o - -S %s | FileCheck %s
> > >  ; RUN: opt -passes=always-inline -o - -S %s | FileCheck %s
> > > 
> > > ```
> > > 
> > Doesn't `-inline` invoke the OPM? I thought `-passes=inline` was NPM and `-inline` was OPM? cc @aeubanks 
> > 
> > If I'm mistaken, then I should make this `-enable-new-pm=0` for `-inline` and fix the test.
> > 
> > I'm also curious how much longer we expect to support OPM (though perhaps it's better not to ask)?
> `-inline` will invoke the new PM if the new PM is enabled by default.
> 
> `-enable-new-pm=0 -inline` will always force the legacy PM
> 
> I just sent out an RFC yesterday to llvm-dev about updating tests
Yikes! Then all of the existing tests using the OPM style command line flags probably should have been switched to explicitly use `-enable-new-pm=0` BEFORE switching the default to NPM.  Now we're potentially missing a lot of OPM test coverage that may be bit rotting.

Let me send a patch fixing up this test.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104958/new/

https://reviews.llvm.org/D104958



More information about the llvm-commits mailing list