https://github.com/zahiraam closed
https://github.com/llvm/llvm-project/pull/107397
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/AaronBallman approved this pull request.
LGTM!
https://github.com/llvm/llvm-project/pull/107397
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/jcranmer-intel approved this pull request.
https://github.com/llvm/llvm-project/pull/107397
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/zahiraam updated
https://github.com/llvm/llvm-project/pull/107397
>From 621578de568be1e71665254060956ea1971965c9 Mon Sep 17 00:00:00 2001
From: Zahira Ammarguellat
Date: Thu, 5 Sep 2024 05:42:26 -0700
Subject: [PATCH 1/9] [NFC] Move warning from COdeGen to Sema.
---
clang/i
@@ -780,6 +780,25 @@ class ASTContext : public RefCountedBase {
const TargetInfo &getTargetInfo() const { return *Target; }
const TargetInfo *getAuxTargetInfo() const { return AuxTarget; }
+ const QualType GetHigherPrecisionFPType(QualType ElementType) const {
+const
@@ -6784,6 +6784,12 @@ def warn_arc_lifetime_result_type : Warning<
"ARC %select{unused|__unsafe_unretained|__strong|__weak|__autoreleasing}0 "
"lifetime qualifier on return type is ignored">,
InGroup;
+def warn_excess_precision_not_supported : Warning<
+ "excess precisi
https://github.com/AaronBallman commented:
Double-checking: we want to diagnose when higher precision is requested but
cannot be honored and failing to honor the request leads to an observable
change in behavior and the only time that should happen currently is with
complex division, so that's
@@ -7964,6 +7964,12 @@ class Sema final : public SemaBase {
/// Do an explicit extend of the given block pointer if we're in ARC.
void maybeExtendBlockObject(ExprResult &E);
+ std::vector>
+ ExcessPrecisionNotSatisfied;
+ unsigned NumExcessPrecisionNotSatisfied = 0;
https://github.com/zahiraam updated
https://github.com/llvm/llvm-project/pull/107397
>From 621578de568be1e71665254060956ea1971965c9 Mon Sep 17 00:00:00 2001
From: Zahira Ammarguellat
Date: Thu, 5 Sep 2024 05:42:26 -0700
Subject: [PATCH 1/8] [NFC] Move warning from COdeGen to Sema.
---
clang/i
@@ -7964,6 +7964,12 @@ class Sema final : public SemaBase {
/// Do an explicit extend of the given block pointer if we're in ARC.
void maybeExtendBlockObject(ExprResult &E);
+ std::vector>
+ ExcessPrecisionNotSatisfied;
+ unsigned NumExcessPrecisionNotSatisfied = 0;
@@ -780,6 +780,22 @@ class ASTContext : public RefCountedBase {
const TargetInfo &getTargetInfo() const { return *Target; }
const TargetInfo *getAuxTargetInfo() const { return AuxTarget; }
+ const QualType GetHigherPrecisionFPType(QualType ElementType) const {
---
zahiraam wrote:
Let's see if this is better.
https://github.com/llvm/llvm-project/pull/107397
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/zahiraam updated
https://github.com/llvm/llvm-project/pull/107397
>From 621578de568be1e71665254060956ea1971965c9 Mon Sep 17 00:00:00 2001
From: Zahira Ammarguellat
Date: Thu, 5 Sep 2024 05:42:26 -0700
Subject: [PATCH 1/7] [NFC] Move warning from COdeGen to Sema.
---
clang/i
@@ -21,6 +25,7 @@ void a() {
EVALF((2. + 3i) + (4. + 5i), 6. + 8i);
EVALF((2. + 3i) - (4. + 5i), -2. - 2i);
EVALF((2. + 3i) * (4. + 5i), -7. + 22i);
+ // div-precision-warning@+1 {{excess precision is requested but the target
does not support excess precision which may
@@ -21,6 +25,7 @@ void a() {
EVALF((2. + 3i) + (4. + 5i), 6. + 8i);
EVALF((2. + 3i) - (4. + 5i), -2. - 2i);
EVALF((2. + 3i) * (4. + 5i), -7. + 22i);
+ // div-precision-warning@+1 {{excess precision is requested but the target
does not support excess precision which may
@@ -21,6 +25,7 @@ void a() {
EVALF((2. + 3i) + (4. + 5i), 6. + 8i);
EVALF((2. + 3i) - (4. + 5i), -2. - 2i);
EVALF((2. + 3i) * (4. + 5i), -7. + 22i);
+ // div-precision-warning@+1 {{excess precision is requested but the target
does not support excess precision which may
AaronBallman wrote:
> > double foo();
> > double d = 2.0 * foo();
>
> That's correct. Only for division and only `-fcomplex-arithmetic=promoted`
> and when the higher precision type of a target is the same than the current
> precision type.
Okay, then I think there's a bit more work to be don
@@ -6784,6 +6784,11 @@ def warn_arc_lifetime_result_type : Warning<
"ARC %select{unused|__unsafe_unretained|__strong|__weak|__autoreleasing}0 "
"lifetime qualifier on return type is ignored">,
InGroup;
+def warn_excess_precision_not_supported : Warning<
+ "excess precisi
@@ -6784,6 +6784,11 @@ def warn_arc_lifetime_result_type : Warning<
"ARC %select{unused|__unsafe_unretained|__strong|__weak|__autoreleasing}0 "
"lifetime qualifier on return type is ignored">,
InGroup;
+def warn_excess_precision_not_supported : Warning<
+ "excess precisi
zahiraam wrote:
> double foo();
> double d = 2.0 * foo();
That's correct. Only for division and only `-fcomplex-arithmetic=promoted` and
when the higher precision type of a target is the same than the current
precision type.
https://github.com/llvm/llvm-project/pull/107397
___
@@ -7964,6 +7964,12 @@ class Sema final : public SemaBase {
/// Do an explicit extend of the given block pointer if we're in ARC.
void maybeExtendBlockObject(ExprResult &E);
+ std::vector>
AaronBallman wrote:
I don't think we need the `SourceLocation` an
@@ -6784,6 +6784,11 @@ def warn_arc_lifetime_result_type : Warning<
"ARC %select{unused|__unsafe_unretained|__strong|__weak|__autoreleasing}0 "
"lifetime qualifier on return type is ignored">,
InGroup;
+def warn_excess_precision_not_supported : Warning<
+ "excess precisi
@@ -21,6 +25,7 @@ void a() {
EVALF((2. + 3i) + (4. + 5i), 6. + 8i);
EVALF((2. + 3i) - (4. + 5i), -2. - 2i);
EVALF((2. + 3i) * (4. + 5i), -7. + 22i);
+ // div-precision-warning@+1 {{excess precision is requested but the target
does not support excess precision which may
@@ -6784,6 +6784,11 @@ def warn_arc_lifetime_result_type : Warning<
"ARC %select{unused|__unsafe_unretained|__strong|__weak|__autoreleasing}0 "
"lifetime qualifier on return type is ignored">,
InGroup;
+def warn_excess_precision_not_supported : Warning<
+ "excess precisi
@@ -7964,6 +7964,12 @@ class Sema final : public SemaBase {
/// Do an explicit extend of the given block pointer if we're in ARC.
void maybeExtendBlockObject(ExprResult &E);
+ std::vector>
+ ExcessPrecisionNotSatisfied;
+ unsigned NumExcessPrecisionNotSatisfied = 0;
@@ -1180,6 +1180,14 @@ void Sema::PrintPragmaAttributeInstantiationPoint() {
diag::note_pragma_attribute_applied_decl_here);
}
+void Sema::DiagnoseExcessPrecision() {
+ if (NumExcessPrecisionNotSatisfied > 0) {
+for (auto &[Loc, Type, Num] : ExcessPrecision
https://github.com/AaronBallman edited
https://github.com/llvm/llvm-project/pull/107397
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/AaronBallman commented:
We're currently only tracking the precision loss for complex division, but
doesn't it also apply to any use of a floating-point type? e.g.,
```
double foo();
double d = 2.0 * foo();
```
would still not use the higher precision, right? The only differenc
@@ -6784,6 +6784,11 @@ def warn_arc_lifetime_result_type : Warning<
"ARC %select{unused|__unsafe_unretained|__strong|__weak|__autoreleasing}0 "
"lifetime qualifier on return type is ignored">,
InGroup;
+def warn_excess_precision_not_supported : Warning<
+ "excess precisi
https://github.com/zahiraam updated
https://github.com/llvm/llvm-project/pull/107397
>From 621578de568be1e71665254060956ea1971965c9 Mon Sep 17 00:00:00 2001
From: Zahira Ammarguellat
Date: Thu, 5 Sep 2024 05:42:26 -0700
Subject: [PATCH 1/6] [NFC] Move warning from COdeGen to Sema.
---
clang/i
github-actions[bot] wrote:
:warning: C/C++ code formatter, clang-format found issues in your code.
:warning:
You can test this locally with the following command:
``bash
git-clang-format --diff f77f60400f7a4c0c50bc3e3144cdade3bdf9aa3d
51acb49fa02ce4306e251649d7d7d23c65477d07 --e
https://github.com/zahiraam updated
https://github.com/llvm/llvm-project/pull/107397
>From 621578de568be1e71665254060956ea1971965c9 Mon Sep 17 00:00:00 2001
From: Zahira Ammarguellat
Date: Thu, 5 Sep 2024 05:42:26 -0700
Subject: [PATCH 1/5] [NFC] Move warning from COdeGen to Sema.
---
clang/i
https://github.com/Endilll edited
https://github.com/llvm/llvm-project/pull/107397
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Endilll edited
https://github.com/llvm/llvm-project/pull/107397
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -626,6 +626,11 @@ class Sema final : public SemaBase {
const llvm::MapVector &
getMismatchingDeleteExpressions() const;
+ std::vector>
+ ExcessPrecisionNotSatisfied;
Endilll wrote:
Or `(Num >1 ? 1 : 0)` if you wany
https://github.com/llvm/llvm-p
https://github.com/Endilll edited
https://github.com/llvm/llvm-project/pull/107397
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1180,6 +1180,16 @@ void Sema::PrintPragmaAttributeInstantiationPoint() {
diag::note_pragma_attribute_applied_decl_here);
}
+void Sema::DiagnoseExcessPrecision() {
+ if (NumExcessPrecisionNotSatisfied > 0) {
+for (auto &[Loc, Type, Num] : ExcessPrecision
@@ -626,6 +626,11 @@ class Sema final : public SemaBase {
const llvm::MapVector &
getMismatchingDeleteExpressions() const;
+ std::vector>
+ ExcessPrecisionNotSatisfied;
Endilll wrote:
I think all three data members should be moved down to `SemaExpr.
@@ -1180,6 +1180,16 @@ void Sema::PrintPragmaAttributeInstantiationPoint() {
diag::note_pragma_attribute_applied_decl_here);
}
+void Sema::DiagnoseExcessPrecision() {
+ if (NumExcessPrecisionNotSatisfied > 0) {
+for (auto &[Loc, Type, Num] : ExcessPrecision
https://github.com/zahiraam updated
https://github.com/llvm/llvm-project/pull/107397
>From 621578de568be1e71665254060956ea1971965c9 Mon Sep 17 00:00:00 2001
From: Zahira Ammarguellat
Date: Thu, 5 Sep 2024 05:42:26 -0700
Subject: [PATCH 1/4] [NFC] Move warning from COdeGen to Sema.
---
clang/i
@@ -6784,6 +6784,10 @@ def warn_arc_lifetime_result_type : Warning<
"ARC %select{unused|__unsafe_unretained|__strong|__weak|__autoreleasing}0 "
"lifetime qualifier on return type is ignored">,
InGroup;
+def warn_next_larger_fp_type_same_size_than_fp : Warning<
+ "higher
@@ -6784,6 +6784,10 @@ def warn_arc_lifetime_result_type : Warning<
"ARC %select{unused|__unsafe_unretained|__strong|__weak|__autoreleasing}0 "
"lifetime qualifier on return type is ignored">,
InGroup;
+def warn_next_larger_fp_type_same_size_than_fp : Warning<
+ "higher
@@ -6784,6 +6784,10 @@ def warn_arc_lifetime_result_type : Warning<
"ARC %select{unused|__unsafe_unretained|__strong|__weak|__autoreleasing}0 "
"lifetime qualifier on return type is ignored">,
InGroup;
+def warn_next_larger_fp_type_same_size_than_fp : Warning<
+ "higher
@@ -6784,6 +6784,10 @@ def warn_arc_lifetime_result_type : Warning<
"ARC %select{unused|__unsafe_unretained|__strong|__weak|__autoreleasing}0 "
"lifetime qualifier on return type is ignored">,
InGroup;
+def warn_next_larger_fp_type_same_size_than_fp : Warning<
+ "higher
llvmbot wrote:
@llvm/pr-subscribers-clang
@llvm/pr-subscribers-clang-codegen
Author: Zahira Ammarguellat (zahiraam)
Changes
This is a warning that wasn't associated with the source location. Moved it to
Sema and changed the warning message to a more verbose one.
---
Full diff: https://gi
https://github.com/zahiraam ready_for_review
https://github.com/llvm/llvm-project/pull/107397
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/zahiraam updated
https://github.com/llvm/llvm-project/pull/107397
>From 621578de568be1e71665254060956ea1971965c9 Mon Sep 17 00:00:00 2001
From: Zahira Ammarguellat
Date: Thu, 5 Sep 2024 05:42:26 -0700
Subject: [PATCH 1/3] [NFC] Move warning from COdeGen to Sema.
---
clang/i
https://github.com/zahiraam updated
https://github.com/llvm/llvm-project/pull/107397
>From 621578de568be1e71665254060956ea1971965c9 Mon Sep 17 00:00:00 2001
From: Zahira Ammarguellat
Date: Thu, 5 Sep 2024 05:42:26 -0700
Subject: [PATCH 1/2] [NFC] Move warning from COdeGen to Sema.
---
clang/i
https://github.com/zahiraam edited
https://github.com/llvm/llvm-project/pull/107397
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/zahiraam edited
https://github.com/llvm/llvm-project/pull/107397
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/zahiraam created
https://github.com/llvm/llvm-project/pull/107397
None
>From 621578de568be1e71665254060956ea1971965c9 Mon Sep 17 00:00:00 2001
From: Zahira Ammarguellat
Date: Thu, 5 Sep 2024 05:42:26 -0700
Subject: [PATCH] [NFC] Move warning from COdeGen to Sema.
---
clang
51 matches
Mail list logo