I got a bug report from Intel that https://reviews.llvm.org/D72841 was causing a crash on Windows in vs2017 <numeric> header in /std:c++17 mode, because #pragma float_control is used in a namespace. This patch allows float_control to be in a namespace. I checked the Microsoft compiler to see if the namespace caused the effectiveness of the pragma to be scoped (i.e. a pragma in the namespace would not be effective after the namespace closed) and the pragma is still effective after the namespace. I added the test case that I used for the investigation to the LIT tests. I used this compile line and checked the assembly. cl -c test.cpp -Fatest.asm /arch:AVX2 -O2 ; when the pragma is in effect the div instruction is not eliminated.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
No this patch isn't ready yet. i see an assertion if try to instantiate a template function when the template has enabled floating point settings
Comment Actions
I corrected the assertion error by propagating usesFPIntrin flag from the template function to the template instantiation and added a test case. Ready for review.