[PATCH,RFC] allow signext attribute (for Power).

Hal Finkel hfinkel at anl.gov
Thu May 29 15:28:10 PDT 2014


----- Original Message -----
> From: "Will Schmidt" <will_schmidt at vnet.ibm.com>
> To: "Hal Finkel" <hfinkel at anl.gov>
> Cc: "Ulrich Weigand" <Ulrich.Weigand at de.ibm.com>, "William J. Schmidt" <wschmidt at linux.vnet.ibm.com>, "llvm cfe"
> <cfe-commits at cs.uiuc.edu>
> Sent: Thursday, May 29, 2014 4:37:30 PM
> Subject: Re: [PATCH,RFC] allow signext attribute (for Power).
> 
> On Thu, 2014-05-29 at 16:27 -0500, Hal Finkel wrote:
> > Hi Will,
> > 
> > -// CHECK-DAG: define available_externally hidden {{signext
> > i32|i32}} @_ZN1SIiE1gEv({{.*}} #[[ALWAYS_INLINE:.*]] align
> > +// CHECK-DAG: define available_externally hidden {{.*}}i32
> > @_ZN1SIiE1gEv({{.*}} #[[ALWAYS_INLINE:.*]] align
> >  int a = S<int>::g();
> > 
> > I don't understand this... why does {{signext i32|i32}} not work?
> > I'm a bit hesitant to sprinkle {{.*}} in many places; that seems a
> > bit too broad.
> 
> Right..   part of an off-list chat I had with Uli, the potential for
> other attributes (i.e. zeroext) came up. For that reason, decided to
> use
> wildcards, as seen in, say r185649, rather than {signext,}
> variations.
> 
> I could be convinced to go either way, of course.  :-)

I think this is a reasonable point, but I don't want to go too far. How about using [a-z]*.

 -Hal

> 
> Thanks,
> -Will
> 
> 
> 
> > 
> > Thanks again,
> > Hal
> > 
> > ----- Original Message -----
> > > From: "Will Schmidt" <will_schmidt at vnet.ibm.com>
> > > To: "llvm cfe" <cfe-commits at cs.uiuc.edu>
> > > Cc: "Hal Finkel" <hfinkel at anl.gov>, "Ulrich Weigand"
> > > <Ulrich.Weigand at de.ibm.com>, "William J. Schmidt"
> > > <wschmidt at linux.vnet.ibm.com>
> > > Sent: Thursday, May 29, 2014 4:20:06 PM
> > > Subject: [PATCH,RFC] allow signext attribute (for Power).
> > > 
> > > 
> > > Allow the cxx-irgen and parallel_codegen tests to succeed when
> > > the
> > > signext attribute is present.  (As seen on PowerPC).
> > > 
> > > 
> > > This should fix the current failures seen in
> > > Modules/cxx-irgen.cpp
> > > and
> > > OpenMP/parallel_codegen.cpp
> > > http://lab.llvm.org:8011/builders/clang-ppc64-elf-linux2/builds/15027/steps/check-all/logs/Clang%3A%3Acxx-irgen.cpp
> > > and
> > > http://lab.llvm.org:8011/builders/clang-ppc64-elf-linux2/builds/15027/steps/check-all/logs/Clang%3A%3Aparallel_codegen.cpp
> > > 
> > > 
> > > Thanks,
> > > -Will
> > > 
> > > diff --git a/tools/clang/test/Modules/cxx-irgen.cpp
> > > b/tools/clang/test/Modules/cxx-irgen.cpp
> > > index 7c680f8..3b450bc 100644
> > > --- a/tools/clang/test/Modules/cxx-irgen.cpp
> > > +++ b/tools/clang/test/Modules/cxx-irgen.cpp
> > > @@ -4,19 +4,19 @@
> > >  
> > >  @import cxx_irgen_top;
> > >  
> > > -// CHECK-DAG: call i32 @_ZN8CtorInitIiE1fEv(
> > > +// CHECK-DAG: call {{.*}}i32 @_ZN8CtorInitIiE1fEv(
> > >  CtorInit<int> x;
> > >  
> > >  @import cxx_irgen_left;
> > >  @import cxx_irgen_right;
> > >  
> > > -// CHECK-DAG: define available_externally hidden {{signext
> > > i32|i32}}
> > > @_ZN1SIiE1gEv({{.*}} #[[ALWAYS_INLINE:.*]] align
> > > +// CHECK-DAG: define available_externally hidden {{.*}}i32
> > > @_ZN1SIiE1gEv({{.*}} #[[ALWAYS_INLINE:.*]] align
> > >  int a = S<int>::g();
> > >  
> > > -// CHECK-DAG: define available_externally {{signext i32|i32}}
> > > @_ZN1SIiE1fEv({{.*}} #[[ALWAYS_INLINE]] align
> > > +// CHECK-DAG: define available_externally {{.*}}i32
> > > @_ZN1SIiE1fEv({{.*}} #[[ALWAYS_INLINE]] align
> > >  int b = h();
> > >  
> > > -// CHECK-DAG: define linkonce_odr {{signext i32|i32}}
> > > @_Z3minIiET_S0_S0_(i32
> > > +// CHECK-DAG: define linkonce_odr {{.*}}i32
> > > @_Z3minIiET_S0_S0_(i32
> > >  int c = min(1, 2);
> > >  
> > >  // CHECK: attributes #[[ALWAYS_INLINE]] = {{.*}} alwaysinline
> > > diff --git a/tools/clang/test/OpenMP/parallel_codegen.cpp
> > > b/tools/clang/test/OpenMP/parallel_codegen.cpp
> > > index 28505ab..194a4a4 100644
> > > --- a/tools/clang/test/OpenMP/parallel_codegen.cpp
> > > +++ b/tools/clang/test/OpenMP/parallel_codegen.cpp
> > > @@ -34,14 +34,14 @@ int main (int argc, char **argv) {
> > >    return tmain(argv);
> > >  }
> > >  
> > > -// CHECK-LABEL: define i32 @main(i32 %argc, i8** %argv)
> > > +// CHECK-LABEL: define {{.*}}i32 @main(i32 {{.*}}%argc, i8**
> > > %argv)
> > >  // CHECK:       [[AGG_CAPTURED:%.+]] = alloca %struct.anon
> > >  // CHECK:       [[ARGC_REF:%.+]] = getelementptr inbounds
> > >  %struct.anon* [[AGG_CAPTURED]], i32 0, i32 0
> > >  // CHECK-NEXT:  store i32* {{%[a-z0-9.]+}}, i32** [[ARGC_REF]]
> > >  // CHECK-NEXT:  [[BITCAST:%.+]] = bitcast %struct.anon*
> > >  [[AGG_CAPTURED]] to i8*
> > >  // CHECK-NEXT:  call void (%ident_t*, i32, void (i32*, i32*,
> > >  ...)*,
> > >  ...)* @__kmpc_fork_call(%ident_t* [[DEF_LOC_2]], i32 1, void
> > >  (i32*,
> > >  i32*, ...)* bitcast (void (i32*, i32*, %struct.anon*)*
> > >  @__captured_stmt to void (i32*, i32*, ...)*), i8* [[BITCAST]])
> > >  // CHECK-NEXT:  [[ARGV:%.+]] = load i8*** {{%[a-z0-9.]+}}
> > > -// CHECK-NEXT:  [[RET:%.+]] = call i32 [[TMAIN:@.+tmain.+]](i8**
> > > [[ARGV]])
> > > +// CHECK-NEXT:  [[RET:%.+]] = call {{.*}}i32
> > > [[TMAIN:@.+tmain.+]](i8** [[ARGV]])
> > >  // CHECK-NEXT:  ret i32 [[RET]]
> > >  // CHECK-NEXT:  }
> > >  // CHECK-DEBUG-LABEL: define i32 @main(i32 %argc, i8** %argv)
> > > @@ -68,7 +68,7 @@ int main (int argc, char **argv) {
> > >  // CHECK-NEXT:  [[ARGC_PTR_REF:%.+]] = getelementptr inbounds
> > >  %struct.anon* [[CONTEXT_PTR]], i32 0, i32 0
> > >  // CHECK-NEXT:  [[ARGC_REF:%.+]] = load i32** [[ARGC_PTR_REF]]
> > >  // CHECK-NEXT:  [[ARGC:%.+]] = load i32* [[ARGC_REF]]
> > > -// CHECK-NEXT:  invoke void [[FOO:@.+foo.+]](i32 [[ARGC]])
> > > +// CHECK-NEXT:  invoke void [[FOO:@.+foo.+]](i32 {{.*}}[[ARGC]])
> > >  // CHECK:       ret void
> > >  // CHECK:       call void @{{.+terminate.*}}(
> > >  // CHECK-NEXT:  unreachable
> > > @@ -86,12 +86,12 @@ int main (int argc, char **argv) {
> > >  // CHECK-DEBUG-NEXT:  unreachable
> > >  // CHECK-DEBUG-NEXT:  }
> > >  
> > > -// CHECK-DAG: define linkonce_odr void [[FOO]](i32 %argc)
> > > +// CHECK-DAG: define linkonce_odr void [[FOO]](i32 {{.*}}%argc)
> > >  // CHECK-DAG: declare void @__kmpc_fork_call(%ident_t*, i32,
> > >  void
> > >  (i32*, i32*, ...)*, ...)
> > >  // CHECK-DEBUG-DAG: define linkonce_odr void [[FOO]](i32 %argc)
> > >  // CHECK-DEBUG-DAG: declare void @__kmpc_fork_call(%ident_t*,
> > >  i32,
> > >  void (i32*, i32*, ...)*, ...)
> > >  
> > > -// CHECK:       define linkonce_odr i32 [[TMAIN]](i8** %argc)
> > > +// CHECK:       define linkonce_odr {{.*}}i32 [[TMAIN]](i8**
> > > %argc)
> > >  // CHECK:       [[AGG_CAPTURED:%.+]] = alloca %struct.anon.0
> > >  // CHECK:       [[ARGC_REF:%.+]] = getelementptr inbounds
> > >  %struct.anon.0* [[AGG_CAPTURED]], i32 0, i32 0
> > >  // CHECK-NEXT:  store i8*** {{%[a-z0-9.]+}}, i8**** [[ARGC_REF]]
> > > 
> > > 
> > > 
> > > 
> > 
> 
> 
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory



More information about the cfe-commits mailing list