[PATCH] D99675: RFC [llvm][clang] Create new intrinsic llvm.arith.fence to control FP optimization at expression level

Kevin P. Neal via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 18 07:51:43 PDT 2021


kpn added a comment.

In D99675#2696327 <https://reviews.llvm.org/D99675#2696327>, @pengfei wrote:

> In D99675#2695424 <https://reviews.llvm.org/D99675#2695424>, @kpn wrote:
>
>> What changes are needed for a backend, and what happens if they aren't done?
>
> As far as I understand it, backend does optimizations based on patterns of the known nodes and MIs. Inserting a new node/MI will block any optimizations across the fence. So it respects the semantics of the intrinsic without target special chenges.
> I'm not sure if there's room for optimization cross the `arithmetic.fence`. If there is and no changes for it, backend may have some performance loss under these circumstances.
>
>> Having something needed for correctness silently not work seems ... sub-optimal.
>
> I think backend is conservative for optimizations when use the intrinsic. It won't have correctness issue silently, but performance loss might.

OK, that sounds fine, then.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99675



More information about the cfe-commits mailing list