Currently, __builtin_frame_address() is required for OMPT. And
LoongArch only supports the current frame (i.e. depth = 0). So
this will fail if the depth != 0.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
This change is only necessary and will be unneeded when __builtin_frame_address is implemented. OpenMP support is bringing up. LoongArch should not cause unnecessary churn to the upstream.
LoongArch users building openmp can disable LIBOMP_OMPT_SUPPORT for now.
Comment Actions
For __builtin_frame_address(depth) where depth > 0, can we return 0 directly if frame pointer elimination is enabled to avoid the issue mentioned here.
I wonder how gcc handle case?
Comment Actions
GCC documentation claims:
On some machines it may be impossible to determine the frame address of any function other than the current one; in such cases, or when the top of the stack has been reached, this function returns '0' if the first frame pointer is properly initialized by the startup code. Calling this function with a nonzero argument can have unpredictable effects, including crashing the calling program. As a result, calls that are considered unsafe are diagnosed when the '-Wframe-address' option is in effect. Such calls should only be made in debugging situations.
Comment Actions
I have abandoned this diff.
We'll try to support that condition where depth != 0 later .
Comment Actions
If I read the code correctly, calling __builtin_frame_address with a depth > 0 is only used in tests. Can we disable those tests if __builtin_frame_address cannot handle depth > 0?