Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] main from llvm:main #152

Merged
merged 25 commits into from
Oct 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
6aaf1e7
[LoopIdiom] Fix store size SCEV type.
legrosbuffle Oct 7, 2021
c63cb0c
[LLDB] Skip TestScriptedProcess on Arm/AArch64 Linux
omjavaid Oct 11, 2021
83ded5d
re-land "[AA] Teach BasicAA to recognize basic GEP range information."
legrosbuffle Oct 11, 2021
b0eef1e
[fir] Add the abstract result conversion pass
clementval Oct 11, 2021
cd1bd95
[libcxx][pretty printers] Disable u16string tests
DavidSpickett Oct 11, 2021
26b7d9d
[LoopVectorize] Permit vectorisation of more select(cmp(), X, Y) redu…
david-arm Aug 4, 2021
342d7b6
[BasicAA][NFC] Improve comment.
legrosbuffle Oct 11, 2021
7ae8f39
[AArch64] Emit AssertZExt for i1 arguments
asavonic Jul 29, 2021
d11ec6f
[Clang] Enable IC/IF mode for __ibm128
ecnelises Oct 11, 2021
483db1c
[LLDB] Remove xfail decorator TestInferiorAssert.py AArch64/Linux
omjavaid Oct 11, 2021
fee461b
[lldb] [ConnectionFileDescriptorPosix] Combine m_read_sp & m_write_sp
mgorny Oct 8, 2021
36195d7
[lldb] [DynamicRegisterInfo] Remove non-const GetRegisterInfoAtIndex()
mgorny Oct 8, 2021
8093c2e
[lldb] Make char[N] formatters respect the end of the array (PR44649)
labath Oct 8, 2021
03065ec
[AArch64][SVE] Ensure LowerEXTRACT_SUBVECTOR is not called for illega…
brads55 Oct 8, 2021
592e89c
[lldb] Don't print to stderr in TypeSystemClang::GetBuiltinTypeForDWA…
Teemperor Oct 11, 2021
3256aa8
[lldb] Add support for DW_AT_calling_convention to the DWARF parser
Teemperor Oct 11, 2021
6f8ef1d
[flang][driver] Add actions that execute despite semantic errors
banach-space Oct 7, 2021
edec659
[fir] Update clang-tidy for the Optimizer directory
schweitzpgi Oct 11, 2021
270c989
[lldb] [test] Rewrite g/p/G/P tests not to rely on hardcoded ARM regs
mgorny Oct 9, 2021
aaeba64
[LLD] [TEST] Add test case for patching an absolute relocation to a w…
bd1976bris Oct 11, 2021
f110999
[lldb][NFCI] Refactor out attribute parsing from DWARFASTParserClang:…
Teemperor Oct 11, 2021
84adaab
[X86][AVX] Add test case for PR52122
RKSimon Oct 11, 2021
31a2ccc
[fir] Clean up InitFIR.h
schweitzpgi Oct 11, 2021
8249e50
[lldb][NFC] Remove unnecessary reference from ParseChildMembers's def…
Teemperor Oct 11, 2021
ad16c6e
[X86][AVX] Ensure we retain zero elements in select(pshufb,pshufb) ->…
RKSimon Oct 11, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions clang/lib/Basic/TargetInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,11 +297,11 @@ FloatModeKind TargetInfo::getRealTypeByWidth(unsigned BitWidth,
if (ExplicitType == FloatModeKind::Float128)
return hasFloat128Type() ? FloatModeKind::Float128
: FloatModeKind::NoFloat;
if (&getLongDoubleFormat() == &llvm::APFloat::PPCDoubleDouble() ||
&getLongDoubleFormat() == &llvm::APFloat::IEEEquad())
return FloatModeKind::LongDouble;
if (hasFloat128Type())
return FloatModeKind::Float128;
if (ExplicitType == FloatModeKind::Ibm128)
return hasIbm128Type() ? FloatModeKind::Ibm128
: FloatModeKind::NoFloat;
if (ExplicitType == FloatModeKind::LongDouble)
return ExplicitType;
break;
}

Expand Down
4 changes: 4 additions & 0 deletions clang/lib/Sema/SemaDeclAttr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4233,6 +4233,10 @@ static void parseModeAttrArg(Sema &S, StringRef Str, unsigned &DestWidth,
ExplicitType = FloatModeKind::LongDouble;
DestWidth = 128;
break;
case 'I':
ExplicitType = FloatModeKind::Ibm128;
DestWidth = Str[1] == 'I' ? 0 : 128;
break;
}
if (Str[1] == 'F') {
IntegerMode = false;
Expand Down
9 changes: 9 additions & 0 deletions clang/test/CodeGenCXX/ibm128-declarations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ template <__ibm128 Q> struct T2 {
constexpr static __ibm128 mem = Q;
};

typedef float w128ibm __attribute__((mode(IF)));
typedef _Complex float w128ibm_c __attribute__((mode(IC)));

w128ibm icmode_self(w128ibm x) { return x; }
w128ibm_c icmode_self_complex(w128ibm_c x) { return x; }

int main(void) {
__ibm128 lf;
CTest ct(lf);
Expand Down Expand Up @@ -115,6 +121,9 @@ int main(void) {
// CHECK: ret ppc_fp128 %2
// CHECK: }

// CHECK: define dso_local ppc_fp128 @_Z11icmode_selfg(ppc_fp128 %x)
// CHECK: define dso_local { ppc_fp128, ppc_fp128 } @_Z19icmode_self_complexCg(ppc_fp128 %x.coerce0, ppc_fp128 %x.coerce1)

// CHECK: define dso_local signext i32 @main()
// CHECK: entry:
// CHECK: %0 = load ppc_fp128, ppc_fp128* %lf, align 16
Expand Down
6 changes: 6 additions & 0 deletions clang/test/Sema/attr-mode.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ void f_ft128_arg(long double *x);
void f_ft128_complex_arg(_Complex long double *x);
void test_TFtype(f128ibm *a) { f_ft128_arg (a); }
void test_TCtype(c128ibm *a) { f_ft128_complex_arg (a); }
typedef float w128ibm __attribute__((mode(IF)));
typedef _Complex float cw128ibm __attribute__((mode(IC)));
void f_ibm128_arg(__ibm128 *x);
void f_ibm128_complex_arg(_Complex __ibm128 *x);
void test_IFtype(w128ibm *a) { f_ibm128_arg(a); }
void test_ICtype(cw128ibm *a) { f_ibm128_complex_arg(a); }
#elif TEST_F128_PPC64
typedef int invalid_7 __attribute((mode(KF))); // expected-error{{type of machine mode does not match type of base type}}
typedef int invalid_8 __attribute((mode(KI))); // expected-error{{unknown machine mode}}
Expand Down
23 changes: 19 additions & 4 deletions flang/include/flang/Frontend/FrontendActions.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ class DebugDumpParseTreeNoSemaAction : public PrescanAndParseAction {

//===----------------------------------------------------------------------===//
// PrescanAndSema Actions
//
// These actions will parse the input, run the semantic checks and execute
// their actions provided that no parsing or semantic errors were found.
//===----------------------------------------------------------------------===//
class PrescanAndSemaAction : public FrontendAction {

Expand All @@ -107,10 +110,6 @@ class DebugDumpParseTreeAction : public PrescanAndSemaAction {
void ExecuteAction() override;
};

class DebugDumpAllAction : public PrescanAndSemaAction {
void ExecuteAction() override;
};

class DebugPreFIRTreeAction : public PrescanAndSemaAction {
void ExecuteAction() override;
};
Expand All @@ -131,6 +130,22 @@ class PluginParseTreeAction : public PrescanAndSemaAction {
void ExecuteAction() override = 0;
};

//===----------------------------------------------------------------------===//
// PrescanAndSemaDebug Actions
//
// These actions will parse the input, run the semantic checks and execute
// their actions regardless of whether any semantic errors are found.
//===----------------------------------------------------------------------===//
class PrescanAndSemaDebugAction : public FrontendAction {

void ExecuteAction() override = 0;
bool BeginSourceFileAction() override;
};

class DebugDumpAllAction : public PrescanAndSemaDebugAction {
void ExecuteAction() override;
};

} // namespace Fortran::frontend

#endif // LLVM_FLANG_FRONTEND_FRONTENDACTIONS_H
10 changes: 10 additions & 0 deletions flang/include/flang/Optimizer/.clang-tidy
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
Checks: '-readability-braces-around-statements,readability-identifier-naming,llvm-include-order,clang-diagnostic-*'
InheritParentConfig: true
CheckOptions:
- key: readability-identifier-naming.ClassCase
value: CamelCase
- key: readability-identifier-naming.EnumCase
value: CamelCase
- key: readability-identifier-naming.FunctionCase
value: camelBack
- key: readability-identifier-naming.MemberCase
value: camelBack
- key: readability-identifier-naming.ParameterCase
value: camelBack
- key: readability-identifier-naming.UnionCase
value: CamelCase
- key: readability-identifier-naming.VariableCase
value: camelBack
- key: readability-identifier-naming.IgnoreMainLikeFunctions
value: 1
14 changes: 6 additions & 8 deletions flang/include/flang/Optimizer/Support/InitFIR.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,18 @@
#include "mlir/Pass/PassRegistry.h"
#include "mlir/Transforms/LocationSnapshot.h"
#include "mlir/Transforms/Passes.h"
#include "flang/Optimizer/CodeGen/CodeGen.h"

namespace fir::support {

// The definitive list of dialects used by flang.
#define FLANG_DIALECT_LIST \
mlir::AffineDialect, FIROpsDialect, FIRCodeGenDialect, \
mlir::LLVM::LLVMDialect, mlir::acc::OpenACCDialect, \
#define FLANG_NONCODEGEN_DIALECT_LIST \
mlir::AffineDialect, FIROpsDialect, mlir::acc::OpenACCDialect, \
mlir::omp::OpenMPDialect, mlir::scf::SCFDialect, \
mlir::StandardOpsDialect, mlir::vector::VectorDialect

// The definitive list of dialects used by flang.
#define FLANG_DIALECT_LIST \
FLANG_NONCODEGEN_DIALECT_LIST, FIRCodeGenDialect, mlir::LLVM::LLVMDialect

/// Register all the dialects used by flang.
inline void registerDialects(mlir::DialectRegistry &registry) {
registry.insert<FLANG_DIALECT_LIST>();
Expand Down Expand Up @@ -70,9 +71,6 @@ inline void registerMLIRPassesForFortranTools() {
mlir::registerAffineDataCopyGenerationPass();

mlir::registerConvertAffineToStandardPass();

// Flang passes
fir::registerOptCodeGenPasses();
}

} // namespace fir::support
Expand Down
1 change: 1 addition & 0 deletions flang/include/flang/Optimizer/Transforms/Passes.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ namespace fir {
// Passes defined in Passes.td
//===----------------------------------------------------------------------===//

std::unique_ptr<mlir::Pass> createAbstractResultOptPass();
std::unique_ptr<mlir::Pass> createAffineDemotionPass();
std::unique_ptr<mlir::Pass> createCharacterConversionPass();
std::unique_ptr<mlir::Pass> createExternalNameConversionPass();
Expand Down
21 changes: 20 additions & 1 deletion flang/include/flang/Optimizer/Transforms/Passes.td
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//
//
// This file contains definitions for passes within the Optimizer/Transforms/
// directory.
// directory.
//
//===----------------------------------------------------------------------===//

Expand All @@ -16,6 +16,25 @@

include "mlir/Pass/PassBase.td"

def AbstractResultOpt : Pass<"abstract-result-opt", "mlir::FuncOp"> {
let summary = "Convert fir.array, fir.box and fir.rec function result to "
"function argument";
let description = [{
This pass is required before code gen to the LLVM IR dialect,
including the pre-cg rewrite pass.
}];
let constructor = "::fir::createAbstractResultOptPass()";
let dependentDialects = [
"fir::FIROpsDialect", "mlir::StandardOpsDialect"
];
let options = [
Option<"passResultAsBox", "abstract-result-as-box",
"bool", /*default=*/"false",
"Pass fir.array<T> result as fir.box<fir.array<T>> argument instead"
" of fir.ref<fir.array<T>>.">
];
}

def AffineDialectPromotion : FunctionPass<"promote-to-affine"> {
let summary = "Promotes `fir.{do_loop,if}` to `affine.{for,if}`.";
let description = [{
Expand Down
5 changes: 5 additions & 0 deletions flang/lib/Frontend/FrontendActions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ bool PrescanAndSemaAction::BeginSourceFileAction() {
return RunPrescan() && RunParse() && RunSemanticChecks();
}

bool PrescanAndSemaDebugAction::BeginSourceFileAction() {
// Semantic checks are made to succeed unconditionally.
return RunPrescan() && RunParse() && (RunSemanticChecks() || true);
}

//===----------------------------------------------------------------------===//
// Custom ExecuteAction
//===----------------------------------------------------------------------===//
Expand Down
10 changes: 10 additions & 0 deletions flang/lib/Optimizer/.clang-tidy
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
Checks: '-readability-braces-around-statements,readability-identifier-naming,llvm-include-order,clang-diagnostic-*'
InheritParentConfig: true
CheckOptions:
- key: readability-identifier-naming.ClassCase
value: CamelCase
- key: readability-identifier-naming.EnumCase
value: CamelCase
- key: readability-identifier-naming.FunctionCase
value: camelBack
- key: readability-identifier-naming.MemberCase
value: camelBack
- key: readability-identifier-naming.ParameterCase
value: camelBack
- key: readability-identifier-naming.UnionCase
value: CamelCase
- key: readability-identifier-naming.VariableCase
value: camelBack
- key: readability-identifier-naming.IgnoreMainLikeFunctions
value: 1
3 changes: 2 additions & 1 deletion flang/lib/Optimizer/Dialect/FIROps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,8 @@ void fir::CallOp::build(mlir::OpBuilder &builder, mlir::OperationState &result,
llvm::ArrayRef<mlir::Type> results,
mlir::ValueRange operands) {
result.addOperands(operands);
result.addAttribute(getCalleeAttrName(), callee);
if (callee)
result.addAttribute(getCalleeAttrName(), callee);
result.addTypes(results);
}

Expand Down
Loading