[PATCH] D65019: [ARM] push LR before __gnu_mcount_nc

Jian Cai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 7 18:21:59 PDT 2019


jcai19 marked an inline comment as done.
jcai19 added a comment.

In D65019#1619511 <https://reviews.llvm.org/D65019#1619511>, @efriedma wrote:

> This seems better.
>
> I'm not sure I follow why this needs special handling in SelectionDAGBuilder::visitIntrinsicCall, as opposed to just using ISD::INTRINSIC_VOID like other similar target-specific intrinsics.  (You can custom-lower INTRINSIC_VOID in ARMTargetLowering::LowerOperation, if that makes it easier.)


Thanks for the suggestion, and I agree the code would look cleaner this way.  But I have some questions on implementation details, and please bear with me if they seem naive since I am new to backend. So I have been trying to reuse the code of  ARMTargetLowering::LowerCall to build a SelectionDAG call node for the new intrinsic, which essentially is a function call with a push instruction before. If we handle the intrinsic at ARMTargetLowering::LowerOperation until legalize DAG stage, then I am not sure if we can still do that, as some of the information needed is gone by this stage. I did see code handling ARM intrinsic on ARMTargetLowering::LowerOperation, but they didn't seem to need to generate function calls later.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65019





More information about the llvm-commits mailing list