[PATCH] D24815: [clang] make reciprocal estimate codegen a function attribute

Sanjay Patel via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 4 08:17:14 PDT 2016


spatel added inline comments.


> mehdi_amini wrote in CGCall.cpp:1735
> I wonder if we couldn’t have this part of the bitcode/IR auto-upgrade: when we load a function with this attribute, we automatically add the individual flag on every instruction.

Auto-upgrading is part of the solution. Based on how we've been doing this with vector intrinsics that get converted to IR, it's a ~3-step process:

1. Prepare the backend (DAG) to handle the expected new IR patterns and add tests for those.
2. Auto-upgrade the IR, remove deprecated handling of the old IR patterns, and change/remove existing tests.
3. Update clang to not produce the deprecated patterns.

The extra step for FMF in the DAG is that we still don't allow FMF on all SDNode subclasses. The DAG plumbing for FMF only applies to binops because that's all that FMF on IR worked on at the time (fmul/fadd/fsub/fdiv/frem). Later, I added FMF to IR calls so we could have that functionality on sqrt, fma and other calls. Assuming that is ok (and I realize that it may be controversial), we can now extend FMF in the DAG to all SDNodes and have a full node-level FMF solution for the DAG layer.

https://reviews.llvm.org/D24815





More information about the cfe-commits mailing list