@@ -109,14 +126,15 @@ class OpenACCClauseCIREmitter final
}
void VisitDeviceTypeClause(const OpenACCDeviceTypeClause &clause) {
+lastDeviceTypeClause = &clause;
andykaylor wrote:
What's the lifetime of this object? Who owns it?
https://github.com/llv
@@ -109,14 +126,15 @@ class OpenACCClauseCIREmitter final
}
void VisitDeviceTypeClause(const OpenACCDeviceTypeClause &clause) {
+lastDeviceTypeClause = &clause;
if constexpr (isOneOfTypes) {
llvm::SmallVector deviceTypes;
std::optional existingDevice
andykaylor wrote:
> ALSO, I see no tests that contain `ty_anon`, can you write some?
We don't actually generate anon records (either upstream or in the incubator).
I think we should just make them illegal. Anonymous structs in the source are
given a name in CIR (`anon.`)
https://github.com/ll
@@ -309,6 +309,37 @@ RecordType::computeStructAlignment(const mlir::DataLayout
&dataLayout) const {
return recordAlignment;
}
+uint64_t RecordType::getElementOffset(const ::mlir::DataLayout &dataLayout,
+ unsigned idx) const {
+ assert(
@@ -1419,6 +1419,50 @@ def CallOp : CIR_CallOpBase<"call", [NoRegionArguments]>
{
}]>];
}
+//===--===//
+// StackSave & StackRestoreOp
andykaylor wrote:
```suggestion
// StackSaveOp & St
@@ -1419,6 +1419,50 @@ def CallOp : CIR_CallOpBase<"call", [NoRegionArguments]>
{
}]>];
}
+//===--===//
+// StackSave & StackRestoreOp
+//===---
https://github.com/andykaylor edited
https://github.com/llvm/llvm-project/pull/136426
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,19 @@
+// RUN: cir-opt %s -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR
andykaylor wrote:
Can you also add a RUN line to lower this to LLVM IR?
https://github.com/llvm/llvm-project/pull/136426
___
cfe-
@@ -1419,6 +1419,50 @@ def CallOp : CIR_CallOpBase<"call", [NoRegionArguments]>
{
}]>];
}
+//===--===//
+// StackSave & StackRestoreOp
+//===---
https://github.com/andykaylor approved this pull request.
Looks good, with a couple of minor requests.
https://github.com/llvm/llvm-project/pull/136426
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listi
@@ -1419,6 +1419,50 @@ def CallOp : CIR_CallOpBase<"call", [NoRegionArguments]>
{
}]>];
}
+//===--===//
+// StackSave & StackRestoreOp
+//===---
@@ -637,6 +637,42 @@ ArrayType::getABIAlignment(const ::mlir::DataLayout
&dataLayout,
return dataLayout.getTypeABIAlignment(getEltType());
}
+//===--===//
+// VectorType Definitions
+//===--
@@ -637,6 +637,42 @@ ArrayType::getABIAlignment(const ::mlir::DataLayout
&dataLayout,
return dataLayout.getTypeABIAlignment(getEltType());
}
+//===--===//
+// VectorType Definitions
+//===--
@@ -82,6 +82,9 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy {
cir::IntType>(ty))
return true;
+if (mlir::isa(ty))
andykaylor wrote:
```suggestion
if (auto vt = mlir::dyn_cast(ty))
```
Then this would replace the `mli
@@ -399,6 +399,14 @@ mlir::Type CIRGenTypes::convertType(QualType type) {
break;
}
+ case Type::ExtVector:
+ case Type::Vector: {
+const VectorType *vec = cast(ty);
+const mlir::Type elemTy = convertTypeForMem(vec->getElementType());
andykaylor
https://github.com/andykaylor approved this pull request.
Looks good to me. Just a couple of nits regarding the comment block.
https://github.com/llvm/llvm-project/pull/136626
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.o
https://github.com/andykaylor edited
https://github.com/llvm/llvm-project/pull/136626
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -97,11 +97,13 @@ class OpenACCClauseCIREmitter final
// Handle a clause affected by the 'device-type' to the point that they need
// to have the attributes added in the correct/corresponding order, such as
- // 'num_workers' or 'vector_length' on a compute construct.
-
@@ -97,11 +97,13 @@ class OpenACCClauseCIREmitter final
// Handle a clause affected by the 'device-type' to the point that they need
// to have the attributes added in the correct/corresponding order, such as
- // 'num_workers' or 'vector_length' on a compute construct.
-
https://github.com/andykaylor approved this pull request.
lgtm
https://github.com/llvm/llvm-project/pull/137634
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -306,3 +320,71 @@ CIRGenTypes::computeRecordLayout(const RecordDecl *rd,
cir::RecordType *ty) {
// TODO: implement verification
return rl;
}
+
+void CIRRecordLowering::lowerUnion() {
+ CharUnits layoutSize = astRecordLayout.getSize();
+ mlir::Type storageType = nullpt
@@ -5,25 +5,146 @@
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm %s -o %t.ll
// RUN: FileCheck --check-prefix=OGCG --input-file=%t.ll %s
+union U1 {
andykaylor wrote:
Can you add tests for a union that requires padding, a union that is packed
@@ -5,25 +5,146 @@
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm %s -o %t.ll
// RUN: FileCheck --check-prefix=OGCG --input-file=%t.ll %s
+union U1 {
+ int n;
+ char c;
+};
+
+// CIR: !rec_U1 = !cir.record
+// LLVM: %union.U1 = type { i32 }
+// OGCG: %union.
@@ -306,3 +320,71 @@ CIRGenTypes::computeRecordLayout(const RecordDecl *rd,
cir::RecordType *ty) {
// TODO: implement verification
return rl;
}
+
+void CIRRecordLowering::lowerUnion() {
+ CharUnits layoutSize = astRecordLayout.getSize();
+ mlir::Type storageType = nullpt
@@ -306,3 +320,71 @@ CIRGenTypes::computeRecordLayout(const RecordDecl *rd,
cir::RecordType *ty) {
// TODO: implement verification
return rl;
}
+
+void CIRRecordLowering::lowerUnion() {
+ CharUnits layoutSize = astRecordLayout.getSize();
+ mlir::Type storageType = nullpt
@@ -306,3 +320,71 @@ CIRGenTypes::computeRecordLayout(const RecordDecl *rd,
cir::RecordType *ty) {
// TODO: implement verification
return rl;
}
+
+void CIRRecordLowering::lowerUnion() {
+ CharUnits layoutSize = astRecordLayout.getSize();
+ mlir::Type storageType = nullpt
@@ -306,3 +320,71 @@ CIRGenTypes::computeRecordLayout(const RecordDecl *rd,
cir::RecordType *ty) {
// TODO: implement verification
return rl;
}
+
+void CIRRecordLowering::lowerUnion() {
+ CharUnits layoutSize = astRecordLayout.getSize();
+ mlir::Type storageType = nullpt
@@ -317,20 +317,25 @@ LValue CIRGenFunction::emitLValueForField(LValue base,
const FieldDecl *field) {
}
unsigned recordCVR = base.getVRQualifiers();
- if (rec->isUnion()) {
-cgm.errorNYI(field->getSourceRange(), "emitLValueForField: union");
-return LValue();
-
@@ -230,17 +230,41 @@ void RecordType::complete(ArrayRef members, bool
packed, bool padded) {
llvm_unreachable("failed to complete record");
}
+/// Return the largest member of in the type.
+///
+/// Recurses into union members never returning a union as the largest membe
@@ -5,25 +5,146 @@
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm %s -o %t.ll
// RUN: FileCheck --check-prefix=OGCG --input-file=%t.ll %s
+union U1 {
+ int n;
+ char c;
+};
+
+// CIR: !rec_U1 = !cir.record
+// LLVM: %union.U1 = type { i32 }
+// OGCG: %union.
@@ -524,7 +523,9 @@ CIRGenTypes::arrangeCIRFunctionInfo(CanQualType returnType)
{
if (retInfo.canHaveCoerceToType() && retInfo.getCoerceToType() == nullptr)
retInfo.setCoerceToType(convertType(fi->getReturnType()));
- assert(!cir::MissingFeatures::opCallArgs());
+ for
@@ -13,20 +13,76 @@
#include "CIRGenCall.h"
#include "CIRGenFunction.h"
+#include "CIRGenFunctionInfo.h"
#include "clang/CIR/MissingFeatures.h"
using namespace clang;
using namespace clang::CIRGen;
-CIRGenFunctionInfo *CIRGenFunctionInfo::create(CanQualType resultType)
@@ -13,20 +13,76 @@
#include "CIRGenCall.h"
#include "CIRGenFunction.h"
+#include "CIRGenFunctionInfo.h"
#include "clang/CIR/MissingFeatures.h"
using namespace clang;
using namespace clang::CIRGen;
-CIRGenFunctionInfo *CIRGenFunctionInfo::create(CanQualType resultType)
@@ -13,20 +13,76 @@
#include "CIRGenCall.h"
#include "CIRGenFunction.h"
+#include "CIRGenFunctionInfo.h"
#include "clang/CIR/MissingFeatures.h"
using namespace clang;
using namespace clang::CIRGen;
-CIRGenFunctionInfo *CIRGenFunctionInfo::create(CanQualType resultType)
@@ -47,18 +98,51 @@ class CIRGenFunctionInfo final
// This function has to be CamelCase because llvm::FoldingSet requires so.
// NOLINTNEXTLINE(readability-identifier-naming)
- static void Profile(llvm::FoldingSetNodeID &id, CanQualType resultType) {
+ static void Profil
@@ -32,8 +32,14 @@ void X8664ABIInfo::computeInfo(CIRGenFunctionInfo &funcInfo)
const {
// Top level CIR has unlimited arguments and return types. Lowering for ABI
// specific concerns should happen during a lowering phase. Assume everything
// is direct for now.
- asse
@@ -13,20 +13,76 @@
#include "CIRGenCall.h"
#include "CIRGenFunction.h"
+#include "CIRGenFunctionInfo.h"
#include "clang/CIR/MissingFeatures.h"
using namespace clang;
using namespace clang::CIRGen;
-CIRGenFunctionInfo *CIRGenFunctionInfo::create(CanQualType resultType)
@@ -47,18 +98,51 @@ class CIRGenFunctionInfo final
// This function has to be CamelCase because llvm::FoldingSet requires so.
// NOLINTNEXTLINE(readability-identifier-naming)
- static void Profile(llvm::FoldingSetNodeID &id, CanQualType resultType) {
+ static void Profil
@@ -13,20 +13,76 @@
#include "CIRGenCall.h"
#include "CIRGenFunction.h"
+#include "CIRGenFunctionInfo.h"
#include "clang/CIR/MissingFeatures.h"
using namespace clang;
using namespace clang::CIRGen;
-CIRGenFunctionInfo *CIRGenFunctionInfo::create(CanQualType resultType)
@@ -47,18 +98,51 @@ class CIRGenFunctionInfo final
// This function has to be CamelCase because llvm::FoldingSet requires so.
// NOLINTNEXTLINE(readability-identifier-naming)
- static void Profile(llvm::FoldingSetNodeID &id, CanQualType resultType) {
+ static void Profil
@@ -13,20 +13,76 @@
#include "CIRGenCall.h"
#include "CIRGenFunction.h"
+#include "CIRGenFunctionInfo.h"
#include "clang/CIR/MissingFeatures.h"
using namespace clang;
using namespace clang::CIRGen;
-CIRGenFunctionInfo *CIRGenFunctionInfo::create(CanQualType resultType)
@@ -13,20 +13,76 @@
#include "CIRGenCall.h"
#include "CIRGenFunction.h"
+#include "CIRGenFunctionInfo.h"
#include "clang/CIR/MissingFeatures.h"
using namespace clang;
using namespace clang::CIRGen;
-CIRGenFunctionInfo *CIRGenFunctionInfo::create(CanQualType resultType)
@@ -13,20 +13,76 @@
#include "CIRGenCall.h"
#include "CIRGenFunction.h"
+#include "CIRGenFunctionInfo.h"
#include "clang/CIR/MissingFeatures.h"
using namespace clang;
using namespace clang::CIRGen;
-CIRGenFunctionInfo *CIRGenFunctionInfo::create(CanQualType resultType)
https://github.com/andykaylor updated
https://github.com/llvm/llvm-project/pull/136387
>From f161bed5972815b535fb21b48ec243d483978685 Mon Sep 17 00:00:00 2001
From: Andy Kaylor
Date: Fri, 18 Apr 2025 16:24:53 -0700
Subject: [PATCH 1/3] [CIR] Introduce type aliases for records
This introduces M
@@ -639,13 +674,82 @@ cir::FuncOp
CIRGenModule::getAddrOfFunction(clang::GlobalDecl gd,
funcType = convertType(fd->getType());
}
- assert(!cir::MissingFeatures::mangledNames());
- cir::FuncOp func = getOrCreateCIRFunction(
- cast(gd.getDecl())->getIdentifier()->g
https://github.com/andykaylor updated
https://github.com/llvm/llvm-project/pull/137094
>From 8268f7f56d522af6d6f4d1becc8c12b4c049b235 Mon Sep 17 00:00:00 2001
From: Andy Kaylor
Date: Wed, 23 Apr 2025 17:10:05 -0700
Subject: [PATCH 1/2] [CIR] Upstream support for name mangling
We have been usin
@@ -95,19 +95,41 @@ class OpenACCClauseCIREmitter final
.CaseLower("radeon", mlir::acc::DeviceType::Radeon);
}
- // Handle a clause affected by the 'device-type' to the point that they need
- // to have the attributes added in the correct/corresponding order, such
@@ -753,6 +755,221 @@ def ScopeOp : CIR_Op<"scope", [
];
}
+//===--===//
+// SwitchOp
+//===--===//
+
+def CaseOpKind_DT : I32EnumAttrCase<
https://github.com/andykaylor edited
https://github.com/llvm/llvm-project/pull/138001
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/andykaylor created
https://github.com/llvm/llvm-project/pull/138001
This adds basic support for handling reference values.
>From 1aaf67db799b0fb8d2593d9978b0fd9c27bf6e7e Mon Sep 17 00:00:00 2001
From: Andy Kaylor
Date: Wed, 30 Apr 2025 10:30:32 -0700
Subject: [PATCH] [CIR] U
@@ -102,3 +102,20 @@ size_type max_size() {
// CHECK: %3 = cir.cast(integral, %2 : !s32i), !u64i
// CHECK: %4 = cir.const #cir.int<8> : !u64i
// CHECK: %5 = cir.binop(div, %3, %4) : !u64i
+
+void ref_arg(int &x) {
+ int y = x;
+ x = 3;
+}
andykaylor wro
@@ -439,7 +439,13 @@ LValue CIRGenFunction::emitDeclRefLValue(const DeclRefExpr
*e) {
cgm.errorNYI(e->getSourceRange(), "emitDeclRefLValue: static local");
}
-return makeAddrLValue(addr, ty, AlignmentSource::Type);
+// Drill into reference types.
+LValue
https://github.com/andykaylor updated
https://github.com/llvm/llvm-project/pull/138001
Rate limit ยท GitHub
body {
background-color: #f6f8fa;
color: #24292e;
font-family: -apple-system,BlinkMacSystemFont,Segoe
UI,Helvetica,Arial,san
@@ -102,3 +102,20 @@ size_type max_size() {
// CHECK: %3 = cir.cast(integral, %2 : !s32i), !u64i
// CHECK: %4 = cir.const #cir.int<8> : !u64i
// CHECK: %5 = cir.binop(div, %3, %4) : !u64i
+
+void ref_arg(int &x) {
+ int y = x;
+ x = 3;
+}
andykaylor wro
https://github.com/andykaylor created
https://github.com/llvm/llvm-project/pull/138041
This adds support for explicit pointer arithmetic, including unary increment
and decrement of pointer values.
>From ae1fd50a03a0e5f7c0c40463dc6a07f981f79f66 Mon Sep 17 00:00:00 2001
From: Andy Kaylor
Date:
https://github.com/andykaylor closed
https://github.com/llvm/llvm-project/pull/138001
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/andykaylor edited
https://github.com/llvm/llvm-project/pull/137216
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -13,20 +13,76 @@
#include "CIRGenCall.h"
#include "CIRGenFunction.h"
+#include "CIRGenFunctionInfo.h"
#include "clang/CIR/MissingFeatures.h"
using namespace clang;
using namespace clang::CIRGen;
-CIRGenFunctionInfo *CIRGenFunctionInfo::create(CanQualType resultType)
@@ -13,20 +13,76 @@
#include "CIRGenCall.h"
#include "CIRGenFunction.h"
+#include "CIRGenFunctionInfo.h"
#include "clang/CIR/MissingFeatures.h"
using namespace clang;
using namespace clang::CIRGen;
-CIRGenFunctionInfo *CIRGenFunctionInfo::create(CanQualType resultType)
@@ -233,6 +233,19 @@ int f8(int *p) {
// OGCG: %[[P2:.*]] = load ptr, ptr %[[P_PTR]], align 8
// OGCG: %[[STAR_P:.*]] = load i32, ptr %[[P2]], align 4
+
+void f9() {}
andykaylor wrote:
It seems like a lot of code was added compared to what is covered by t
https://github.com/andykaylor closed
https://github.com/llvm/llvm-project/pull/136387
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -253,3 +253,8 @@ size_type max_size(void) {
// OGCG: define{{.*}} i64 @max_size()
// OGCG: ret i64 2305843009213693951
+
+enum {
+ um = 0,
+ dois = 1,
+};
andykaylor wrote:
It looks like you don't have a newline at the end of the file.
https://github.
https://github.com/andykaylor closed
https://github.com/llvm/llvm-project/pull/137094
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/andykaylor created
https://github.com/llvm/llvm-project/pull/137253
This adds the handlers for Decl::Namespace and Decl::UsingDirective (which is
needed for anonymous namespaces).
>From 8e8baed406019bee2b5acd71b0d08b65360ee032 Mon Sep 17 00:00:00 2001
From: Andy Kaylor
Date
@@ -0,0 +1,55 @@
+// RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-linux-gnu -fclangir
-emit-cir %s -o - 2>&1 | FileCheck %s
+
+// Test anonymous namespace.
+namespace {
+ int g1 = 1;
+
+ // Note: This causes a warning about the function being undefined, but we
+ // curren
https://github.com/andykaylor updated
https://github.com/llvm/llvm-project/pull/137094
>From 8268f7f56d522af6d6f4d1becc8c12b4c049b235 Mon Sep 17 00:00:00 2001
From: Andy Kaylor
Date: Wed, 23 Apr 2025 17:10:05 -0700
Subject: [PATCH 1/3] [CIR] Upstream support for name mangling
We have been usin
https://github.com/andykaylor approved this pull request.
Looks good now that I have at least some idea what segments mean.
https://github.com/llvm/llvm-project/pull/137216
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/
@@ -1246,6 +1246,59 @@ def SelectOp : CIR_Op<"select", [Pure,
}];
}
+//===--===//
+// TernaryOp
+//===--===//
+
+def TernaryOp : CIR_Op<"te
@@ -1058,6 +1058,48 @@ LogicalResult cir::BinOp::verify() {
return mlir::success();
}
+//===--===//
+// TernaryOp
+//===--===//
+
+/// Give
@@ -254,10 +254,61 @@ class CIRLoopOpInterfaceFlattening
}
};
+class CIRTernaryOpFlattening : public mlir::OpRewritePattern {
+public:
+ using OpRewritePattern::OpRewritePattern;
+
+ mlir::LogicalResult
+ matchAndRewrite(cir::TernaryOp op,
+ mlir::Pattern
@@ -609,8 +609,8 @@ def ConditionOp : CIR_Op<"condition", [
//===--===//
def YieldOp : CIR_Op<"yield", [ReturnLike, Terminator,
- ParentOneOf<["IfOp", "ScopeOp", "WhileOp",
-
@@ -1246,6 +1246,59 @@ def SelectOp : CIR_Op<"select", [Pure,
}];
}
+//===--===//
+// TernaryOp
+//===--===//
+
+def TernaryOp : CIR_Op<"te
@@ -1246,6 +1246,59 @@ def SelectOp : CIR_Op<"select", [Pure,
}];
}
+//===--===//
+// TernaryOp
+//===--===//
+
+def TernaryOp : CIR_Op<"te
@@ -254,10 +254,61 @@ class CIRLoopOpInterfaceFlattening
}
};
+class CIRTernaryOpFlattening : public mlir::OpRewritePattern {
+public:
+ using OpRewritePattern::OpRewritePattern;
+
+ mlir::LogicalResult
+ matchAndRewrite(cir::TernaryOp op,
+ mlir::Pattern
@@ -1058,6 +1058,48 @@ LogicalResult cir::BinOp::verify() {
return mlir::success();
}
+//===--===//
+// TernaryOp
+//===--===//
+
+/// Give
https://github.com/andykaylor created
https://github.com/llvm/llvm-project/pull/137271
Until now our function symbol lookup has been assuming that the function did
not exist and creating a definition for it. This caused us to create a
duplicate definition if we ever tried to call a function th
https://github.com/andykaylor closed
https://github.com/llvm/llvm-project/pull/137253
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -773,6 +773,58 @@ cir::FuncOp CIRGenModule::getOrCreateCIRFunction(
StringRef mangledName, mlir::Type funcType, GlobalDecl gd, bool forVTable,
bool dontDefer, bool isThunk, ForDefinition_t isForDefinition,
mlir::ArrayAttr extraAttrs) {
+ const Decl *d = gd.getDe
https://github.com/andykaylor closed
https://github.com/llvm/llvm-project/pull/137366
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -609,8 +609,8 @@ def ConditionOp : CIR_Op<"condition", [
//===--===//
def YieldOp : CIR_Op<"yield", [ReturnLike, Terminator,
- ParentOneOf<["IfOp", "ScopeOp", "WhileOp",
-
@@ -1246,6 +1246,59 @@ def SelectOp : CIR_Op<"select", [Pure,
}];
}
+//===--===//
+// TernaryOp
+//===--===//
+
+def TernaryOp : CIR_Op<"te
https://github.com/andykaylor approved this pull request.
I've still got a couple of open nits about the comments in CIRDialect.cpp, but
otherwise this looks good.
https://github.com/llvm/llvm-project/pull/137184
___
cfe-commits mailing list
cfe-commi
https://github.com/andykaylor closed
https://github.com/llvm/llvm-project/pull/137271
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/andykaylor approved this pull request.
This looks good to me if @xlauko is satisfied with the new changes.
https://github.com/llvm/llvm-project/pull/136488
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.or
https://github.com/andykaylor created
https://github.com/llvm/llvm-project/pull/137366
We have been getting a warning about a default statement in a fully covered
switch statement. This change fixes that by removing the default, updating all
paths to return a value rather than depending on a l
@@ -1785,6 +1850,21 @@ def OpenACC_DataOp : OpenACC_Op<"data",
/// Return the wait devnum value clause for the given device_type if
/// present.
mlir::Value getWaitDevnum(mlir::acc::DeviceType deviceType);
+/// Add an entry to the 'async-only' attribute (clause
@@ -1535,6 +1560,21 @@ def OpenACC_SerialOp : OpenACC_Op<"serial",
static mlir::acc::Construct getConstructId() {
return mlir::acc::Construct::acc_construct_serial;
}
+/// Add an entry to the 'async-only' attribute (clause spelled without
+/// arguments)fo
@@ -753,6 +755,221 @@ def ScopeOp : CIR_Op<"scope", [
];
}
+//===--===//
+// SwitchOp
+//===--===//
+
+def CaseOpKind_DT : I32EnumAttrCase<
@@ -753,6 +755,221 @@ def ScopeOp : CIR_Op<"scope", [
];
}
+//===--===//
+// SwitchOp
+//===--===//
+
+def CaseOpKind_DT : I32EnumAttrCase<
@@ -753,6 +755,221 @@ def ScopeOp : CIR_Op<"scope", [
];
}
+//===--===//
+// SwitchOp
+//===--===//
+
+def CaseOpKind_DT : I32EnumAttrCase<
@@ -753,6 +755,221 @@ def ScopeOp : CIR_Op<"scope", [
];
}
+//===--===//
+// SwitchOp
+//===--===//
+
+def CaseOpKind_DT : I32EnumAttrCase<
@@ -422,6 +428,121 @@ mlir::LogicalResult CIRGenFunction::emitBreakStmt(const
clang::BreakStmt &s) {
return mlir::success();
}
+template
+mlir::LogicalResult
+CIRGenFunction::emitCaseDefaultCascade(const T *stmt, mlir::Type condType,
+
@@ -600,3 +721,99 @@ mlir::LogicalResult CIRGenFunction::emitWhileStmt(const
WhileStmt &s) {
terminateBody(builder, whileOp.getBody(), getLoc(s.getEndLoc()));
return mlir::success();
}
+
+mlir::LogicalResult CIRGenFunction::emitSwitchBody(const Stmt *s) {
+ // It is rare
@@ -753,6 +755,221 @@ def ScopeOp : CIR_Op<"scope", [
];
}
+//===--===//
+// SwitchOp
+//===--===//
+
+def CaseOpKind_DT : I32EnumAttrCase<
@@ -753,6 +755,221 @@ def ScopeOp : CIR_Op<"scope", [
];
}
+//===--===//
+// SwitchOp
+//===--===//
+
+def CaseOpKind_DT : I32EnumAttrCase<
@@ -753,6 +755,221 @@ def ScopeOp : CIR_Op<"scope", [
];
}
+//===--===//
+// SwitchOp
+//===--===//
+
+def CaseOpKind_DT : I32EnumAttrCase<
@@ -753,6 +755,221 @@ def ScopeOp : CIR_Op<"scope", [
];
}
+//===--===//
+// SwitchOp
+//===--===//
+
+def CaseOpKind_DT : I32EnumAttrCase<
@@ -753,6 +755,221 @@ def ScopeOp : CIR_Op<"scope", [
];
}
+//===--===//
+// SwitchOp
+//===--===//
+
+def CaseOpKind_DT : I32EnumAttrCase<
@@ -753,6 +755,221 @@ def ScopeOp : CIR_Op<"scope", [
];
}
+//===--===//
+// SwitchOp
+//===--===//
+
+def CaseOpKind_DT : I32EnumAttrCase<
@@ -1785,6 +1850,21 @@ def OpenACC_DataOp : OpenACC_Op<"data",
/// Return the wait devnum value clause for the given device_type if
/// present.
mlir::Value getWaitDevnum(mlir::acc::DeviceType deviceType);
+/// Add an entry to the 'async-only' attribute (clause
801 - 900 of 1017 matches
Mail list logo