Skip to content

Commit 2eae9c0

Browse files
authored
Merge branch 'main' into main-merge-true16-mc-vop1-more-instruction-2
2 parents 367906a + 3b72c62 commit 2eae9c0

File tree

76 files changed

+5053
-2164
lines changed

Some content is hidden

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

76 files changed

+5053
-2164
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1890,7 +1890,7 @@ defm pseudo_probe_for_profiling : BoolFOption<"pseudo-probe-for-profiling",
18901890
" pseudo probes for sample profiling">>;
18911891
def forder_file_instrumentation : Flag<["-"], "forder-file-instrumentation">,
18921892
Group<f_Group>, Visibility<[ClangOption, CC1Option, CLOption]>,
1893-
HelpText<"Generate instrumented code to collect order file into default.profraw file (overridden by '=' form of option or LLVM_PROFILE_FILE env var)">;
1893+
HelpText<"Generate instrumented code to collect order file into default.profraw file (overridden by '=' form of option or LLVM_PROFILE_FILE env var). Deprecated, please use temporal profiling.">;
18941894
def fprofile_list_EQ : Joined<["-"], "fprofile-list=">,
18951895
Group<f_Group>, Visibility<[ClangOption, CC1Option, CLOption]>,
18961896
HelpText<"Filename defining the list of functions/files to instrument. "

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8010,15 +8010,19 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
80108010
}
80118011
}
80128012

8013-
if (Args.hasArg(options::OPT_forder_file_instrumentation)) {
8014-
CmdArgs.push_back("-forder-file-instrumentation");
8015-
// Enable order file instrumentation when ThinLTO is not on. When ThinLTO is
8016-
// on, we need to pass these flags as linker flags and that will be handled
8017-
// outside of the compiler.
8018-
if (!IsUsingLTO) {
8019-
CmdArgs.push_back("-mllvm");
8020-
CmdArgs.push_back("-enable-order-file-instrumentation");
8021-
}
8013+
if (const Arg *A =
8014+
Args.getLastArg(options::OPT_forder_file_instrumentation)) {
8015+
D.Diag(diag::warn_drv_deprecated_arg)
8016+
<< A->getAsString(Args) << /*hasReplacement=*/true
8017+
<< "-mllvm -pgo-temporal-instrumentation";
8018+
CmdArgs.push_back("-forder-file-instrumentation");
8019+
// Enable order file instrumentation when ThinLTO is not on. When ThinLTO is
8020+
// on, we need to pass these flags as linker flags and that will be handled
8021+
// outside of the compiler.
8022+
if (!IsUsingLTO) {
8023+
CmdArgs.push_back("-mllvm");
8024+
CmdArgs.push_back("-enable-order-file-instrumentation");
8025+
}
80228026
}
80238027

80248028
if (Arg *A = Args.getLastArg(options::OPT_fforce_enable_int128,

clang/test/Driver/clang_f_opts.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@
364364
// RUN: -fno-devirtualize-speculatively \
365365
// RUN: -fslp-vectorize-aggressive \
366366
// RUN: -fno-slp-vectorize-aggressive \
367+
// RUN: -forder-file-instrumentation \
367368
// RUN: %s 2>&1 | FileCheck --check-prefix=CHECK-WARNING %s
368369
// CHECK-WARNING-DAG: optimization flag '-finline-limit=1000' is not supported
369370
// CHECK-WARNING-DAG: optimization flag '-finline-limit' is not supported
@@ -423,6 +424,7 @@
423424
// CHECK-WARNING-DAG: optimization flag '-fno-devirtualize-speculatively' is not supported
424425
// CHECK-WARNING-DAG: the flag '-fslp-vectorize-aggressive' has been deprecated and will be ignored
425426
// CHECK-WARNING-DAG: the flag '-fno-slp-vectorize-aggressive' has been deprecated and will be ignored
427+
// CHECK-WARNING-DAG: argument '-forder-file-instrumentation' is deprecated, use '-mllvm -pgo-temporal-instrumentation' instead
426428

427429
// Test that we mute the warning on these
428430
// RUN: %clang -### -finline-limit=1000 -Wno-invalid-command-line-argument \

flang/lib/Optimizer/Transforms/AddDebugInfo.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ void AddDebugInfoPass::handleDeclareOp(fir::cg::XDeclareOp declOp,
121121
// constant attribute of [hl]fir.declare/fircg.ext_declare operation that has
122122
// a dummy_scope operand).
123123
unsigned argNo = 0;
124-
if (fir::isDummyArgument(declOp.getMemref())) {
125-
auto arg = llvm::cast<mlir::BlockArgument>(declOp.getMemref());
126-
argNo = arg.getArgNumber() + 1;
124+
if (declOp.getDummyScope()) {
125+
if (auto arg = llvm::dyn_cast<mlir::BlockArgument>(declOp.getMemref()))
126+
argNo = arg.getArgNumber() + 1;
127127
}
128128

129129
auto tyAttr = typeGen.convertType(fir::unwrapRefType(declOp.getType()),

flang/lib/Semantics/check-allocate.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -616,9 +616,11 @@ bool AllocationCheckerHelper::RunChecks(SemanticsContext &context) {
616616
}
617617
if (allocateInfo_.gotPinned) {
618618
std::optional<common::CUDADataAttr> cudaAttr{GetCUDADataAttr(ultimate_)};
619-
if (!cudaAttr || *cudaAttr != common::CUDADataAttr::Pinned) {
619+
if ((!cudaAttr || *cudaAttr != common::CUDADataAttr::Pinned) &&
620+
context.languageFeatures().ShouldWarn(
621+
common::UsageWarning::CUDAUsage)) {
620622
context.Say(name_.source,
621-
"Object in ALLOCATE must have PINNED attribute when PINNED option is specified"_err_en_US);
623+
"Object in ALLOCATE should have PINNED attribute when PINNED option is specified"_warn_en_US);
622624
}
623625
}
624626
if (allocateInfo_.gotStream) {
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
! RUN: %flang_fc1 -fopenmp -emit-llvm -debug-info-kind=standalone %s -o -
2+
3+
! Test that this does not cause build failure.
4+
function s(x)
5+
character(len=2) :: x, s, ss
6+
7+
s = x
8+
9+
entry ss()
10+
11+
end function s
12+

flang/test/Semantics/cuf07.cuf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ module m
2828
integer, allocatable, device :: ia(:)
2929
logical :: plog
3030

31-
!ERROR: Object in ALLOCATE must have PINNED attribute when PINNED option is specified
31+
!WARNING: Object in ALLOCATE should have PINNED attribute when PINNED option is specified
3232
allocate(ia(100), pinned = plog)
3333
end subroutine
3434

lld/ELF/InputSection.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class SyntheticSection;
3333
template <class ELFT> class ObjFile;
3434
class OutputSection;
3535

36-
// Returned by InputSectionBase::relsOrRelas. At most one member is empty.
36+
// Returned by InputSectionBase::relsOrRelas. At least two members are empty.
3737
template <class ELFT> struct RelsOrRelas {
3838
Relocs<typename ELFT::Rel> rels;
3939
Relocs<typename ELFT::Rela> relas;

llvm/docs/TableGen/BackEnds.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,8 +1071,6 @@ function. This class provides three fields.
10711071

10721072
* ``bit EarlyOut``. See the third example in `Generic Tables`_.
10731073

1074-
* ``bit ReturnRange``. See the second example in `Generic Tables`_.
1075-
10761074
Here is an example of a secondary key added to the ``CTable`` above. The
10771075
generated function looks up entries based on the ``Name`` and ``Kind`` fields.
10781076

llvm/include/llvm/IR/PatternMatch.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1844,9 +1844,9 @@ struct m_ZeroMask {
18441844
};
18451845

18461846
struct m_SpecificMask {
1847-
ArrayRef<int> &MaskRef;
1848-
m_SpecificMask(ArrayRef<int> &MaskRef) : MaskRef(MaskRef) {}
1849-
bool match(ArrayRef<int> Mask) { return MaskRef == Mask; }
1847+
ArrayRef<int> Val;
1848+
m_SpecificMask(ArrayRef<int> Val) : Val(Val) {}
1849+
bool match(ArrayRef<int> Mask) { return Val == Mask; }
18501850
};
18511851

18521852
struct m_SplatOrPoisonMask {

0 commit comments

Comments
 (0)