https://github.com/andykaylor closed
https://github.com/llvm/llvm-project/pull/150520
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/andykaylor updated
https://github.com/llvm/llvm-project/pull/150520
>From 88039a468792435666e3026b5bf42ad31405d332 Mon Sep 17 00:00:00 2001
From: Andy Kaylor
Date: Thu, 24 Jul 2025 13:14:35 -0700
Subject: [PATCH 1/3] [CIR] Upstream proper function alias lowering
This change
https://github.com/xlauko approved this pull request.
lgtm
https://github.com/llvm/llvm-project/pull/150520
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -257,6 +257,11 @@ class CIRToLLVMFuncOpLowering : public
mlir::OpConversionPattern {
cir::FuncOp func, bool filterArgAndResAttrs,
mlir::SmallVectorImpl &result) const;
+ mlir::LogicalResult
+ matchAndRewriteAlias(cir::FuncOp op, mlir::FlatSymbolRefAttr aliase
@@ -1166,6 +1199,31 @@ void CIRToLLVMFuncOpLowering::lowerFuncAttributes(
}
}
+mlir::LogicalResult CIRToLLVMFuncOpLowering::matchAndRewriteAlias(
+cir::FuncOp op, mlir::FlatSymbolRefAttr aliasee, mlir::Type ty,
+OpAdaptor adaptor, mlir::ConversionPatternRewriter &rew
@@ -1166,6 +1199,31 @@ void CIRToLLVMFuncOpLowering::lowerFuncAttributes(
}
}
+mlir::LogicalResult CIRToLLVMFuncOpLowering::matchAndRewriteAlias(
+cir::FuncOp op, mlir::FlatSymbolRefAttr aliasee, mlir::Type ty,
xlauko wrote:
```suggestion
cir::FuncO
@@ -1190,6 +1248,12 @@ mlir::LogicalResult
CIRToLLVMFuncOpLowering::matchAndRewrite(
resultType ? resultType : mlir::LLVM::LLVMVoidType::get(getContext()),
signatureConversion.getConvertedTypes(),
/*isVarArg=*/fnType.isVarArg());
+
+ // If this is an alias,
@@ -1166,6 +1199,31 @@ void CIRToLLVMFuncOpLowering::lowerFuncAttributes(
}
}
+mlir::LogicalResult CIRToLLVMFuncOpLowering::matchAndRewriteAlias(
+cir::FuncOp op, mlir::FlatSymbolRefAttr aliasee, mlir::Type ty,
+OpAdaptor adaptor, mlir::ConversionPatternRewriter &rew
@@ -919,13 +919,46 @@ rewriteCallOrInvoke(mlir::Operation *op, mlir::ValueRange
callOperands,
memoryEffects, noUnwind, willReturn);
mlir::LLVM::LLVMFunctionType llvmFnTy;
+
+ // Temporary to handle the case where we need to prepend an operand if
@@ -1166,6 +1199,31 @@ void CIRToLLVMFuncOpLowering::lowerFuncAttributes(
}
}
+mlir::LogicalResult CIRToLLVMFuncOpLowering::matchAndRewriteAlias(
+cir::FuncOp op, mlir::FlatSymbolRefAttr aliasee, mlir::Type ty,
+OpAdaptor adaptor, mlir::ConversionPatternRewriter &rew
@@ -919,13 +919,46 @@ rewriteCallOrInvoke(mlir::Operation *op, mlir::ValueRange
callOperands,
memoryEffects, noUnwind, willReturn);
mlir::LLVM::LLVMFunctionType llvmFnTy;
+
+ // Temporary to handle the case where we need to prepend an operand if
@@ -919,13 +919,46 @@ rewriteCallOrInvoke(mlir::Operation *op, mlir::ValueRange
callOperands,
memoryEffects, noUnwind, willReturn);
mlir::LLVM::LLVMFunctionType llvmFnTy;
+
+ // Temporary to handle the case where we need to prepend an operand if
@@ -919,13 +919,46 @@ rewriteCallOrInvoke(mlir::Operation *op, mlir::ValueRange
callOperands,
memoryEffects, noUnwind, willReturn);
mlir::LLVM::LLVMFunctionType llvmFnTy;
+
+ // Temporary to handle the case where we need to prepend an operand if
@@ -919,13 +919,46 @@ rewriteCallOrInvoke(mlir::Operation *op, mlir::ValueRange
callOperands,
memoryEffects, noUnwind, willReturn);
mlir::LLVM::LLVMFunctionType llvmFnTy;
+
+ // Temporary to handle the case where we need to prepend an operand if
llvmbot wrote:
@llvm/pr-subscribers-clang
Author: Andy Kaylor (andykaylor)
Changes
This change implements correct lowering of function aliases to the LLVM dialect.
---
Full diff: https://github.com/llvm/llvm-project/pull/150520.diff
4 Files Affected:
- (modified) clang/lib/CIR/Lowering
https://github.com/andykaylor created
https://github.com/llvm/llvm-project/pull/150520
This change implements correct lowering of function aliases to the LLVM dialect.
>From 88039a468792435666e3026b5bf42ad31405d332 Mon Sep 17 00:00:00 2001
From: Andy Kaylor
Date: Thu, 24 Jul 2025 13:14:35 -070
16 matches
Mail list logo