[clang] The pragma STDC CX_LIMITED_RANGE ON should have precedence. (PR #98520)

Zahira Ammarguellat via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 12 12:23:45 PDT 2024


================
@@ -218,28 +214,31 @@ _Complex float pragma_default_div(_Complex float a, _Complex float b) {
   // IMPRVD-NEXT: fsub float
   // IMPRVD-NEXT: fdiv float
 
-  // PRMTD: load float, ptr {{.*}}
-  // PRMTD: fpext float {{.*}} to double
-  // PRMTD-NEXT: fpext float {{.*}} to double
-  // PRMTD-NEXT: getelementptr inbounds { float, float }, ptr {{.*}}, i32 0, i32 0
-  // PRMTD-NEXT: load float, ptr {{.*}}
-  // PRMTD-NEXT: getelementptr inbounds { float, float }, ptr {{.*}}, i32 0, i32 1
-  // PRMTD-NEXT: load float, ptr {{.*}}
-  // PRMTD-NEXT: fpext float {{.*}} to double
-  // PRMTD-NEXT: fpext float {{.*}} to double
-  // PRMTD-NEXT: fmul double
-  // PRMTD-NEXT: fmul double
-  // PRMTD-NEXT: fadd double
-  // PRMTD-NEXT: fmul double
-  // PRMTD-NEXT: fmul double
-  // PRMTD-NEXT: fadd double
-  // PRMTD-NEXT: fmul double
-  // PRMTD-NEXT: fmul double
-  // PRMTD-NEXT: fsub double
-  // PRMTD-NEXT: fdiv double
-  // PRMTD-NEXT: fdiv double
-  // PRMTD-NEXT: fptrunc double {{.*}} to float
-  // PRMTD-NEXT: fptrunc double {{.*}} to float
+  // PRMTD: call{{.*}}float @llvm.fabs.f32(float {{.*}})
----------------
zahiraam wrote:

mmh! That's because I have added the condition `!Features.hasComplexRangeOverride()` in `getPromotionType`. It is set to true, so it jumps to the next condition. There is override here, except that the value of the range is equal to the LangOpts if the value of the pragma is `DEFAULT`.   I guess I need to check that the value of the override is not equal to the Range of the LangOpt .... Not sure how to do that here.


https://github.com/llvm/llvm-project/pull/98520


More information about the cfe-commits mailing list