Skip to content

Commit eb6357c

Browse files
authored
Merge branch 'main' into upstream-manual-dwarf-index-once-flag
2 parents 48d9eeb + c528f60 commit eb6357c

File tree

85 files changed

+1534
-788
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+1534
-788
lines changed

clang/test/Driver/dxc_fcgl.hlsl

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
// RUN: not %clang_dxc -fcgl -T lib_6_7 foo.hlsl -### %s 2>&1 | FileCheck %s
2-
// RUN: %clang_dxc -fcgl -T lib_6_7 %s -Xclang -verify
1+
// RUN: %clang_dxc -fcgl -T lib_6_7 %s -### %s 2>&1 | FileCheck %s
32

43
// Make sure fcgl option flag which translated into "-emit-llvm" "-disable-llvm-passes".
54
// CHECK: "-emit-llvm"
65
// CHECK-SAME: "-disable-llvm-passes"
7-
8-
// Make sure fcgl option not generate any diagnostics.
9-
// expected-no-diagnostics

compiler-rt/test/asan/TestCases/Darwin/suppressions-sandbox.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
// sandbox-exec isn't available on iOS
1616
// UNSUPPORTED: ios
1717

18-
// Symbolizer fails to find test functions on current macOS bot version
19-
// XFAIL: system-darwin && target=arm{{.*}}
20-
2118
#include <CoreFoundation/CoreFoundation.h>
2219

2320
#if defined(SHARED_LIB)

compiler-rt/test/asan/TestCases/Posix/fread_fwrite.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
// RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-FWRITE
33
// RUN: not %run %t 1 2>&1 | FileCheck %s --check-prefix=CHECK-FREAD
44

5-
// Symbolizer fails to find test functions on current macOS bot version
6-
// XFAIL: system-darwin && target=arm{{.*}}
7-
85
#include <stdio.h>
96
#include <stdlib.h>
107

flang/docs/Extensions.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,13 @@ end
182182
Note that internally the main program symbol name is all uppercase, unlike
183183
the names of all other symbols, which are usually all lowercase. This
184184
may make a difference in testing/debugging.
185+
* A `PROCEDURE()` with no interface name or type may be called as an
186+
subroutine with an implicit interface, F'2023 15.4.3.6 paragraph 4 and
187+
C1525 notwithstanding.
188+
This is a universally portable feature, and it also applies to
189+
`PROCEDURE(), POINTER, NOPASS` derived type components.
190+
Such procedures may *not* be referenced as implicitly typed functions
191+
without first being associated with a function pointer.
185192

186193
## Extensions, deletions, and legacy features supported by default
187194

@@ -954,4 +961,3 @@ print *, [(j,j=1,10)]
954961
"&GRP A(1:)=1. 2. 3./".
955962
This extension is necessarily disabled when the type of the array
956963
has an accessible defined formatted READ subroutine.
957-

flang/include/flang/Evaluate/common.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,10 +303,16 @@ class FoldingContext {
303303
return common::ScopedSet(analyzingPDTComponentKindSelector_, true);
304304
}
305305

306+
common::Restorer<std::string> SetRealFlagWarningContext(std::string str) {
307+
return common::ScopedSet(realFlagWarningContext_, str);
308+
}
309+
306310
parser::CharBlock SaveTempName(std::string &&name) {
307311
return {*tempNames_.emplace(std::move(name)).first};
308312
}
309313

314+
void RealFlagWarnings(const RealFlags &, const char *op);
315+
310316
private:
311317
parser::ContextualMessages messages_;
312318
const common::IntrinsicTypeDefaultKinds &defaults_;
@@ -318,8 +324,8 @@ class FoldingContext {
318324
std::map<parser::CharBlock, ConstantSubscript> impliedDos_;
319325
const common::LanguageFeatureControl &languageFeatures_;
320326
std::set<std::string> &tempNames_;
327+
std::string realFlagWarningContext_;
321328
};
322329

323-
void RealFlagWarnings(FoldingContext &, const RealFlags &, const char *op);
324330
} // namespace Fortran::evaluate
325331
#endif // FORTRAN_EVALUATE_COMMON_H_

flang/include/flang/Optimizer/Dialect/FIROps.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "mlir/Dialect/LLVMIR/LLVMAttrs.h"
2121
#include "mlir/Interfaces/LoopLikeInterface.h"
2222
#include "mlir/Interfaces/SideEffectInterfaces.h"
23+
#include "mlir/Interfaces/ViewLikeInterface.h"
2324

2425
namespace fir {
2526

flang/include/flang/Optimizer/Dialect/FIROps.td

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
include "mlir/Dialect/Arith/IR/ArithBase.td"
1818
include "mlir/Dialect/Arith/IR/ArithOpsInterfaces.td"
1919
include "mlir/Dialect/LLVMIR/LLVMAttrDefs.td"
20+
include "mlir/Interfaces/ViewLikeInterface.td"
2021
include "flang/Optimizer/Dialect/CUF/Attributes/CUFAttr.td"
2122
include "flang/Optimizer/Dialect/FIRDialect.td"
2223
include "flang/Optimizer/Dialect/FIRTypes.td"
@@ -2828,7 +2829,8 @@ def fir_VolatileCastOp : fir_SimpleOneResultOp<"volatile_cast", [Pure]> {
28282829
let hasFolder = 1;
28292830
}
28302831

2831-
def fir_ConvertOp : fir_SimpleOneResultOp<"convert", [NoMemoryEffect]> {
2832+
def fir_ConvertOp
2833+
: fir_SimpleOneResultOp<"convert", [NoMemoryEffect, ViewLikeOpInterface]> {
28322834
let summary = "encapsulates all Fortran entity type conversions";
28332835

28342836
let description = [{
@@ -2866,6 +2868,7 @@ def fir_ConvertOp : fir_SimpleOneResultOp<"convert", [NoMemoryEffect]> {
28662868
static bool isPointerCompatible(mlir::Type ty);
28672869
static bool canBeConverted(mlir::Type inType, mlir::Type outType);
28682870
static bool areVectorsCompatible(mlir::Type inTy, mlir::Type outTy);
2871+
mlir::Value getViewSource() { return getValue(); }
28692872
}];
28702873
let hasCanonicalizer = 1;
28712874
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
//===- FIROpenACCOpsInterfaces.h --------------------------------*- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
//
9+
// This file contains external operation interfaces for FIR.
10+
//
11+
//===----------------------------------------------------------------------===//
12+
13+
#ifndef FLANG_OPTIMIZER_OPENACC_FIROPENACC_OPS_INTERFACES_H_
14+
#define FLANG_OPTIMIZER_OPENACC_FIROPENACC_OPS_INTERFACES_H_
15+
16+
#include "mlir/Dialect/OpenACC/OpenACC.h"
17+
18+
namespace fir {
19+
class DeclareOp;
20+
} // namespace fir
21+
22+
namespace hlfir {
23+
class DeclareOp;
24+
class DesignateOp;
25+
} // namespace hlfir
26+
27+
namespace fir::acc {
28+
29+
template <typename Op>
30+
struct PartialEntityAccessModel
31+
: public mlir::acc::PartialEntityAccessOpInterface::ExternalModel<
32+
PartialEntityAccessModel<Op>, Op> {
33+
mlir::Value getBaseEntity(mlir::Operation *op) const;
34+
35+
// Default implementation - returns false (partial view)
36+
bool isCompleteView(mlir::Operation *op) const { return false; }
37+
};
38+
39+
// Full specializations for declare operations
40+
template <>
41+
struct PartialEntityAccessModel<fir::DeclareOp>
42+
: public mlir::acc::PartialEntityAccessOpInterface::ExternalModel<
43+
PartialEntityAccessModel<fir::DeclareOp>, fir::DeclareOp> {
44+
mlir::Value getBaseEntity(mlir::Operation *op) const;
45+
bool isCompleteView(mlir::Operation *op) const;
46+
};
47+
48+
template <>
49+
struct PartialEntityAccessModel<hlfir::DeclareOp>
50+
: public mlir::acc::PartialEntityAccessOpInterface::ExternalModel<
51+
PartialEntityAccessModel<hlfir::DeclareOp>, hlfir::DeclareOp> {
52+
mlir::Value getBaseEntity(mlir::Operation *op) const;
53+
bool isCompleteView(mlir::Operation *op) const;
54+
};
55+
56+
} // namespace fir::acc
57+
58+
#endif // FLANG_OPTIMIZER_OPENACC_FIROPENACC_OPS_INTERFACES_H_

flang/lib/Evaluate/common.cpp

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,28 @@ using namespace Fortran::parser::literals;
1313

1414
namespace Fortran::evaluate {
1515

16-
void RealFlagWarnings(
17-
FoldingContext &context, const RealFlags &flags, const char *operation) {
16+
void FoldingContext::RealFlagWarnings(
17+
const RealFlags &flags, const char *operation) {
1818
static constexpr auto warning{common::UsageWarning::FoldingException};
1919
if (flags.test(RealFlag::Overflow)) {
20-
context.Warn(warning, "overflow on %s"_warn_en_US, operation);
20+
Warn(warning, "overflow on %s%s"_warn_en_US, operation,
21+
realFlagWarningContext_);
2122
}
2223
if (flags.test(RealFlag::DivideByZero)) {
2324
if (std::strcmp(operation, "division") == 0) {
24-
context.Warn(warning, "division by zero"_warn_en_US);
25+
Warn(warning, "division by zero%s"_warn_en_US, realFlagWarningContext_);
2526
} else {
26-
context.Warn(warning, "division by zero on %s"_warn_en_US, operation);
27+
Warn(warning, "division by zero on %s%s"_warn_en_US, operation,
28+
realFlagWarningContext_);
2729
}
2830
}
2931
if (flags.test(RealFlag::InvalidArgument)) {
30-
context.Warn(warning, "invalid argument on %s"_warn_en_US, operation);
32+
Warn(warning, "invalid argument on %s%s"_warn_en_US, operation,
33+
realFlagWarningContext_);
3134
}
3235
if (flags.test(RealFlag::Underflow)) {
33-
context.Warn(warning, "underflow on %s"_warn_en_US, operation);
36+
Warn(warning, "underflow on %s%s"_warn_en_US, operation,
37+
realFlagWarningContext_);
3438
}
3539
}
3640

flang/lib/Evaluate/fold-implementation.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1862,7 +1862,7 @@ Expr<TO> FoldOperation(
18621862
std::snprintf(buffer, sizeof buffer,
18631863
"INTEGER(%d) to REAL(%d) conversion", Operand::kind,
18641864
TO::kind);
1865-
RealFlagWarnings(ctx, converted.flags, buffer);
1865+
ctx.RealFlagWarnings(converted.flags, buffer);
18661866
}
18671867
return ScalarConstantToExpr(std::move(converted.value));
18681868
} else if constexpr (FromCat == TypeCategory::Real) {
@@ -1871,7 +1871,7 @@ Expr<TO> FoldOperation(
18711871
if (!converted.flags.empty()) {
18721872
std::snprintf(buffer, sizeof buffer,
18731873
"REAL(%d) to REAL(%d) conversion", Operand::kind, TO::kind);
1874-
RealFlagWarnings(ctx, converted.flags, buffer);
1874+
ctx.RealFlagWarnings(converted.flags, buffer);
18751875
}
18761876
if (ctx.targetCharacteristics().areSubnormalsFlushedToZero()) {
18771877
converted.value = converted.value.FlushSubnormalToZero();
@@ -2012,7 +2012,7 @@ Expr<T> FoldOperation(FoldingContext &context, Add<T> &&x) {
20122012
} else {
20132013
auto sum{folded->first.Add(
20142014
folded->second, context.targetCharacteristics().roundingMode())};
2015-
RealFlagWarnings(context, sum.flags, "addition");
2015+
context.RealFlagWarnings(sum.flags, "addition");
20162016
if (context.targetCharacteristics().areSubnormalsFlushedToZero()) {
20172017
sum.value = sum.value.FlushSubnormalToZero();
20182018
}
@@ -2041,7 +2041,7 @@ Expr<T> FoldOperation(FoldingContext &context, Subtract<T> &&x) {
20412041
} else {
20422042
auto difference{folded->first.Subtract(
20432043
folded->second, context.targetCharacteristics().roundingMode())};
2044-
RealFlagWarnings(context, difference.flags, "subtraction");
2044+
context.RealFlagWarnings(difference.flags, "subtraction");
20452045
if (context.targetCharacteristics().areSubnormalsFlushedToZero()) {
20462046
difference.value = difference.value.FlushSubnormalToZero();
20472047
}
@@ -2070,7 +2070,7 @@ Expr<T> FoldOperation(FoldingContext &context, Multiply<T> &&x) {
20702070
} else {
20712071
auto product{folded->first.Multiply(
20722072
folded->second, context.targetCharacteristics().roundingMode())};
2073-
RealFlagWarnings(context, product.flags, "multiplication");
2073+
context.RealFlagWarnings(product.flags, "multiplication");
20742074
if (context.targetCharacteristics().areSubnormalsFlushedToZero()) {
20752075
product.value = product.value.FlushSubnormalToZero();
20762076
}
@@ -2141,7 +2141,7 @@ Expr<T> FoldOperation(FoldingContext &context, Divide<T> &&x) {
21412141
}
21422142
}
21432143
if (!isCanonicalNaNOrInf) {
2144-
RealFlagWarnings(context, quotient.flags, "division");
2144+
context.RealFlagWarnings(quotient.flags, "division");
21452145
}
21462146
if (context.targetCharacteristics().areSubnormalsFlushedToZero()) {
21472147
quotient.value = quotient.value.FlushSubnormalToZero();
@@ -2201,7 +2201,7 @@ Expr<T> FoldOperation(FoldingContext &context, RealToIntPower<T> &&x) {
22012201
[&](auto &y) -> Expr<T> {
22022202
if (auto folded{OperandsAreConstants(x.left(), y)}) {
22032203
auto power{evaluate::IntPower(folded->first, folded->second)};
2204-
RealFlagWarnings(context, power.flags, "power with INTEGER exponent");
2204+
context.RealFlagWarnings(power.flags, "power with INTEGER exponent");
22052205
if (context.targetCharacteristics().areSubnormalsFlushedToZero()) {
22062206
power.value = power.value.FlushSubnormalToZero();
22072207
}

0 commit comments

Comments
 (0)