[PATCH] D129464: [Clang][CodeGen] Set FP options of builder at entry to compound statement

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 15 12:00:14 PDT 2022


rjmccall added a comment.

This property adheres to a function definition, so it seems to me that an explicit *instantiation* ought to preserve it from the instantiated template definition, but an explicit *specialization* ought to be independent.

i.e.

  #pragma float_control(precise, on, push)
  template <typename Ty>
  float func2(Ty) {
    float f1 = 1.0f, f2 = 3.0f;
    return f1 + f2 * 2.0f;
  }
  #pragma float_control(pop)
  
  template float func2<int>(int); // precise
  template <> float func2<long>(long) { ... } // not precise


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D129464



More information about the cfe-commits mailing list