Skip to content

Commit

Permalink
Merged main:f8f934e22c4a into amd-gfx:bd63dc7b6e97
Browse files Browse the repository at this point in the history
Local branch amd-gfx bd63dc7 Merged main:16cf9c9af004 into amd-gfx:251b3d8041ba
Remote branch main f8f934e [libc][NFC] Make the dummy header target under overlay build a library. (llvm#66329)
  • Loading branch information
SC llvm team authored and SC llvm team committed Sep 14, 2023
2 parents bd63dc7 + f8f934e commit f337c8e
Show file tree
Hide file tree
Showing 48 changed files with 416 additions and 1,122 deletions.
664 changes: 0 additions & 664 deletions .github/CODEOWNERS

This file was deleted.

39 changes: 38 additions & 1 deletion .github/new-prs-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ mlir:dlti:

mlir:emitc:
- mlir/**/EmitC/**
- mlir/lib/Target/Cpp/**

mlir:func:
- mlir/**/Func/**
Expand All @@ -183,7 +184,8 @@ mlir:index:
- mlir/**/Index/**

mlir:llvm:
- mlir/**/LLVM/**
- mlir/**/LLVM*
- mlir/**/LLVM*/**

mlir:linalg:
- mlir/**/*linalg/**
Expand Down Expand Up @@ -493,14 +495,19 @@ llvm:ir:
- llvm/lib/IR/**
- llvm/include/llvm/IR/**
- llvm/docs/LangRef.rst
- llvm/unittests/IR/**

llvm:analysis:
- llvm/lib/Analysis/**
- llvm/include/llvm/Analysis/**
- llvm/test/Analysis/**
- llvm/unittests/Analysis/**

llvm:transforms:
- llvm/lib/Transforms/**
- llvm/include/llvm/Transforms/**
- llvm/test/Transforms/**
- llvm/unittests/Transforms/**

clangd:
- clang-tools-extra/clangd/**
Expand Down Expand Up @@ -727,3 +734,33 @@ backend:X86:

third-party:unittests:
- third-party/unittests/**

llvm:binary-utilities:
- llvm/docs/CommandGuide/llvm-*
- llvm/include/llvm/BinaryFormat/**
- llvm/include/llvm/DebugInfo/Symbolize/**
- llvm/include/llvm/ObjCopy/**
- llvm/include/llvm/Object/**
- llvm/lib/BinaryFormat/**
- llvm/lib/DebugInfo/Symbolize/**
- llvm/lib/ObjCopy/**
- llvm/lib/Object/**
- llvm/test/Object/**
- llvm/test/tools/llvm-ar/**
- llvm/test/tools/llvm-cxxfilt/**
- llvm/test/tools/llvm-nm/**
- llvm/test/tools/llvm-objcopy/**
- llvm/test/tools/llvm-objdump/**
- llvm/test/tools/llvm-readobj/**
- llvm/test/tools/llvm-size/**
- llvm/test/tools/llvm-strings/**
- llvm/test/tools/llvm-symbolizer/**
- llvm/tools/llvm-ar/**
- llvm/tools/llvm-cxxfilt/**
- llvm/tools/llvm-nm/**
- llvm/tools/llvm-objcopy/**
- llvm/tools/llvm-objdump/**
- llvm/tools/llvm-readobj/**
- llvm/tools/llvm-size/**
- llvm/tools/llvm-strings/**
- llvm/tools/llvm-symbolizer/**
3 changes: 0 additions & 3 deletions clang/include/clang/Basic/DiagnosticDriverKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -674,9 +674,6 @@ def err_cc1_round_trip_mismatch : Error<
def err_cc1_unbounded_vscale_min : Error<
"minimum vscale must be an unsigned integer greater than 0">;

def err_drv_using_omit_rtti_component_without_no_rtti : Error<
"-fexperimental-omit-vtable-rtti call only be used with -fno-rtti">;

def err_drv_ssp_missing_offset_argument : Error<
"'%0' is used without '-mstack-protector-guard-offset', and there is no default">;

Expand Down
3 changes: 0 additions & 3 deletions clang/include/clang/Basic/LangOptions.def
Original file line number Diff line number Diff line change
Expand Up @@ -450,9 +450,6 @@ LANGOPT(SpeculativeLoadHardening, 1, 0, "Speculative load hardening enabled")
LANGOPT(RelativeCXXABIVTables, 1, 0,
"Use an ABI-incompatible v-table layout that uses relative references")

LANGOPT(OmitVTableRTTI, 1, 0,
"Use an ABI-incompatible v-table layout that omits the RTTI component")

LANGOPT(VScaleMin, 32, 0, "Minimum vscale value")
LANGOPT(VScaleMax, 32, 0, "Maximum vscale value")

Expand Down
6 changes: 0 additions & 6 deletions clang/include/clang/Driver/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -2671,12 +2671,6 @@ def fno_experimental_relative_cxx_abi_vtables :
Group<f_clang_Group>, Visibility<[ClangOption, CC1Option]>,
HelpText<"Do not use the experimental C++ class ABI for classes with virtual tables">;

defm experimental_omit_vtable_rtti : BoolFOption<"experimental-omit-vtable-rtti",
LangOpts<"OmitVTableRTTI">, DefaultFalse,
PosFlag<SetTrue, [], [CC1Option], "Omit">,
NegFlag<SetFalse, [], [CC1Option], "Do not omit">,
BothFlags<[], [CC1Option], " the RTTI component from virtual tables">>;

def fcxx_abi_EQ : Joined<["-"], "fc++-abi=">,
Group<f_clang_Group>, Visibility<[ClangOption, CC1Option]>,
HelpText<"C++ ABI to use. This will override the target C++ ABI.">;
Expand Down
9 changes: 2 additions & 7 deletions clang/lib/AST/VTableBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -665,11 +665,7 @@ CharUnits VCallAndVBaseOffsetBuilder::getCurrentOffsetOffset() const {
// vtable address point. (We subtract 3 to account for the information just
// above the address point, the RTTI info, the offset to top, and the
// vcall offset itself).
size_t NumComponentsAboveAddrPoint = 3;
if (Context.getLangOpts().OmitVTableRTTI)
NumComponentsAboveAddrPoint--;
int64_t OffsetIndex =
-(int64_t)(NumComponentsAboveAddrPoint + Components.size());
int64_t OffsetIndex = -(int64_t)(3 + Components.size());

// Under the relative ABI, the offset widths are 32-bit ints instead of
// pointer widths.
Expand Down Expand Up @@ -1673,8 +1669,7 @@ void ItaniumVTableBuilder::LayoutPrimaryAndSecondaryVTables(
Components.push_back(VTableComponent::MakeOffsetToTop(OffsetToTop));

// Next, add the RTTI.
if (!Context.getLangOpts().OmitVTableRTTI)
Components.push_back(VTableComponent::MakeRTTI(MostDerivedClass));
Components.push_back(VTableComponent::MakeRTTI(MostDerivedClass));

uint64_t AddressPoint = Components.size();

Expand Down
6 changes: 0 additions & 6 deletions clang/lib/Driver/ToolChains/Clang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5526,9 +5526,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
Args.AddLastArg(CmdArgs, options::OPT_fexperimental_relative_cxx_abi_vtables,
options::OPT_fno_experimental_relative_cxx_abi_vtables);

Args.AddLastArg(CmdArgs, options::OPT_fexperimental_omit_vtable_rtti,
options::OPT_fno_experimental_omit_vtable_rtti);

// Handle segmented stacks.
Args.addOptInFlag(CmdArgs, options::OPT_fsplit_stack,
options::OPT_fno_split_stack);
Expand Down Expand Up @@ -6010,9 +6007,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
Args.AddLastArg(CmdArgs, options::OPT_fexperimental_relative_cxx_abi_vtables,
options::OPT_fno_experimental_relative_cxx_abi_vtables);

Args.AddLastArg(CmdArgs, options::OPT_fexperimental_omit_vtable_rtti,
options::OPT_fno_experimental_omit_vtable_rtti);

if (Arg *A = Args.getLastArg(options::OPT_ffuchsia_api_level_EQ))
A->render(Args, CmdArgs);

Expand Down
8 changes: 0 additions & 8 deletions clang/lib/Frontend/CompilerInvocation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4109,14 +4109,6 @@ bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args,
options::OPT_fno_experimental_relative_cxx_abi_vtables,
TargetCXXABI::usesRelativeVTables(T));

// RTTI is on by default.
bool HasRTTI = Args.hasFlag(options::OPT_frtti, options::OPT_fno_rtti, true);
Opts.OmitVTableRTTI =
Args.hasFlag(options::OPT_fexperimental_omit_vtable_rtti,
options::OPT_fno_experimental_omit_vtable_rtti, false);
if (Opts.OmitVTableRTTI && HasRTTI)
Diags.Report(diag::err_drv_using_omit_rtti_component_without_no_rtti);

for (const auto &A : Args.getAllArgValues(OPT_fmacro_prefix_map_EQ)) {
auto Split = StringRef(A).split('=');
Opts.MacroPrefixMap.insert(
Expand Down

This file was deleted.

51 changes: 0 additions & 51 deletions clang/test/CodeGenCXX/OmitRTTIComponentABI/vbase-offset.cpp

This file was deleted.

19 changes: 0 additions & 19 deletions clang/test/CodeGenCXX/OmitRTTIComponentABI/vtable-layout.cpp

This file was deleted.

5 changes: 0 additions & 5 deletions clang/test/Driver/omit-rtti-component-flag.cpp

This file was deleted.

15 changes: 0 additions & 15 deletions clang/test/Driver/omit-rtti-component-without-no-rtti.cpp

This file was deleted.

3 changes: 3 additions & 0 deletions flang/include/flang/Lower/OpenACC.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ void attachDeclarePreDeallocAction(AbstractConverter &, fir::FirOpBuilder &,
void attachDeclarePostDeallocAction(AbstractConverter &, fir::FirOpBuilder &,
const Fortran::semantics::Symbol &);

void genOpenACCTerminator(fir::FirOpBuilder &, mlir::Operation *,
mlir::Location);

} // namespace lower
} // namespace Fortran

Expand Down
9 changes: 9 additions & 0 deletions flang/lib/Lower/OpenACC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3299,3 +3299,12 @@ void Fortran::lower::attachDeclarePostDeallocAction(
/*preAlloc=*/{}, /*postAlloc=*/{}, /*preDealloc=*/{},
/*postDealloc=*/builder.getSymbolRefAttr(fctName.str())));
}

void Fortran::lower::genOpenACCTerminator(fir::FirOpBuilder &builder,
mlir::Operation *op,
mlir::Location loc) {
if (mlir::isa<mlir::acc::ParallelOp, mlir::acc::LoopOp>(op))
builder.create<mlir::acc::YieldOp>(loc);
else
builder.create<mlir::acc::TerminatorOp>(loc);
}
5 changes: 5 additions & 0 deletions flang/lib/Lower/Runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include "flang/Lower/Runtime.h"
#include "flang/Lower/Bridge.h"
#include "flang/Lower/OpenACC.h"
#include "flang/Lower/OpenMP.h"
#include "flang/Lower/StatementContext.h"
#include "flang/Optimizer/Builder/FIRBuilder.h"
Expand All @@ -21,6 +22,7 @@
#include "flang/Runtime/stop.h"
#include "flang/Runtime/time-intrinsic.h"
#include "flang/Semantics/tools.h"
#include "mlir/Dialect/OpenACC/OpenACC.h"
#include "mlir/Dialect/OpenMP/OpenMPDialect.h"
#include "llvm/Support/Debug.h"
#include <optional>
Expand All @@ -37,6 +39,9 @@ static void genUnreachable(fir::FirOpBuilder &builder, mlir::Location loc) {
if (parentOp->getDialect()->getNamespace() ==
mlir::omp::OpenMPDialect::getDialectNamespace())
Fortran::lower::genOpenMPTerminator(builder, parentOp, loc);
else if (parentOp->getDialect()->getNamespace() ==
mlir::acc::OpenACCDialect::getDialectNamespace())
Fortran::lower::genOpenACCTerminator(builder, parentOp, loc);
else
builder.create<fir::UnreachableOp>(loc);
mlir::Block *newBlock = curBlock->splitBlock(builder.getInsertionPoint());
Expand Down
4 changes: 2 additions & 2 deletions flang/test/Lower/OpenACC/acc-unstructured.f90
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ subroutine test_unstructured2(a, b, c)
! CHECK: acc.parallel
! CHECK: acc.loop
! CHECK: fir.call @_FortranAStopStatementText
! CHECK: fir.unreachable
! CHECK: acc.yield
! CHECK: acc.yield
! CHECK: acc.yield

Expand All @@ -80,7 +80,7 @@ subroutine test_unstructured3(a, b, c)
! CHECK-LABEL: func.func @_QPtest_unstructured3
! CHECK: acc.parallel
! CHECK: fir.call @_FortranAStopStatementText
! CHECK: fir.unreachable
! CHECK: acc.yield
! CHECK: acc.yield

end subroutine
2 changes: 1 addition & 1 deletion flang/test/Lower/OpenACC/stop-stmt-in-region.f90
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ subroutine test_stop_in_region1()
! CHECK: %[[VAL_2:.*]] = arith.constant false
! CHECK: %[[VAL_3:.*]] = arith.constant false
! CHECK: %[[VAL_4:.*]] = fir.call @_FortranAStopStatement(%[[VAL_1]], %[[VAL_2]], %[[VAL_3]]) {{.*}} : (i32, i1, i1) -> none
! CHECK: fir.unreachable
! CHECK: acc.yield
! CHECK: }
! CHECK: return
! CHECK: }
Expand Down
2 changes: 0 additions & 2 deletions libc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ add_compile_definitions(LIBC_NAMESPACE=${LIBC_NAMESPACE})
# Flags to pass down to the compiler while building the libc functions.
set(LIBC_COMPILE_OPTIONS_DEFAULT "" CACHE STRING "Architecture to tell clang to optimize for (e.g. -march=... or -mcpu=...)")

include(common_libc_tuners.cmake)

list(APPEND LIBC_COMPILE_OPTIONS_DEFAULT ${LIBC_COMMON_TUNE_OPTIONS})

# Check --print-resource-dir to find the compiler resource dir if this flag
Expand Down
2 changes: 1 addition & 1 deletion libc/cmake/modules/LLVMLibCHeaderRules.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function(add_gen_header target_name)
get_fq_target_name(${target_name} fq_target_name)
if(NOT LLVM_LIBC_FULL_BUILD)
# We don't want to use generated headers if we are doing a non-full-build.
add_custom_target(${fq_target_name})
add_library(${fq_target_name} INTERFACE)
return()
endif()
if(NOT ADD_GEN_HDR_DEF_FILE)
Expand Down
2 changes: 2 additions & 0 deletions libc/cmake/modules/LLVMLibCObjectRules.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,7 @@ function(create_entrypoint_object fq_target_name)
target_compile_options(${internal_target_name} BEFORE PRIVATE ${common_compile_options})
target_include_directories(${internal_target_name} PRIVATE ${include_dirs})
add_dependencies(${internal_target_name} ${full_deps_list})
target_link_libraries(${internal_target_name} ${full_deps_list})

add_library(
${fq_target_name}
Expand All @@ -685,6 +686,7 @@ function(create_entrypoint_object fq_target_name)
target_compile_options(${fq_target_name} BEFORE PRIVATE ${common_compile_options} -DLIBC_COPT_PUBLIC_PACKAGING)
target_include_directories(${fq_target_name} PRIVATE ${include_dirs})
add_dependencies(${fq_target_name} ${full_deps_list})
target_link_libraries(${fq_target_name} ${full_deps_list})
endif()

set_target_properties(
Expand Down
Loading

0 comments on commit f337c8e

Please sign in to comment.