This patch is to add the lowering of the LOC intrinsic.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Thanks for working on this, looks great for data "x", see my suggestion to support procedures.
flang/lib/Lower/IntrinsicCall.cpp | ||
---|---|---|
883 | Could you update https://github.com/llvm/llvm-project/blob/09f7554890026aa454a4e5fb2508b411084ac7e0/flang/lib/Evaluate/intrinsics.cpp#L577 table so that the argument name is also "x" for consistency ? | |
3764 | This will probably no work when "x" is a procedure. I think "loc" extension has to work with procedures too (at least flang semantics accepts them). |
flang/lib/Lower/IntrinsicCall.cpp | ||
---|---|---|
883 | Will do. | |
3764 | Good point. I missed the procedure case. The advantage of the genCLocOrCFunLoc routine is that whether the argument is a procedure or not is passed in. loc intrinsic accepts both and getLoc needs some logic to determine if the incoming is fir.embox or fir.emboxproc assuming that the arg is already lowered to either. In order to share the portion of the code in genCLocOrCFunLoc, I did some re-arrangement of the assert statements. |
Address review comments:
- sync up the argument keyword
- share code with genCLocOrCFunLoc
@jeanPerier Thanks for the review. Should I include the update of Intrinsics.md (i.e. remove LOC from the unsupported list) in this patch?
That is a good idea, yes. Thanks.
Looks good otherwise, thanks for addressing my comments.
Could you update https://github.com/llvm/llvm-project/blob/09f7554890026aa454a4e5fb2508b411084ac7e0/flang/lib/Evaluate/intrinsics.cpp#L577 table so that the argument name is also "x" for consistency ?