[Chapel Merge] Move some method definitions into headers

Branch: refs/heads/main
Revision: d443ee5
Author: aconsroe-hpe
Link: Unavailable
Log Message:

Merge pull request #18961 from aconsroe-hpe/inlining-1

Move some method definitions into headers

reviewed by @vasslitvinov

Move some method definitions into headers

These small method definitions are being moved into their header files
so that they are eligible for inlining, which most of these almost
certainly will.

This was motivated by seeing these methods commonly show up in the top
20 of profiling reports:

  • Symbol::hasFlag
  • CallExpr::isPrimitive
  • Expr::inTree
  • AList::get
  • Symbol::isRef

I used a bit of loose judgement to move some related functions if they
felt sufficiently small and/or similar to one of the above. I also
chose to keep the method definitions outside the class as it makes a
better diff.

I had to move the class definition for Expr into expr-class-def.h so
that the alist.h header can implement the ::get method. Expr contains
an AList so it also needs to know the full layout. Without major
changes to header structure, this was my solution.

I verified most of these actually do get inlined and saw a 3-5%
reduction in compiling hello, cg-sparse-timecomp, and arkouda.

Passes paratest

Modified Files:
A compiler/include/expr-class-def.h

M compiler/AST/CallExpr.cpp
M compiler/AST/alist.cpp
M compiler/AST/expr.cpp
M compiler/AST/symbol.cpp
M compiler/include/CallExpr.h
M compiler/include/alist.h
M compiler/include/expr.h
M compiler/include/symbol.h

Compare: https://github.com/chapel-lang/chapel/compare/087e07b81002...d443ee579977