[clang] [CIR] Upstream proper function alias lowering (PR #150520)

2025-07-29 Thread Andy Kaylor via cfe-commits
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

[clang] [CIR] Upstream proper function alias lowering (PR #150520)

2025-07-29 Thread Andy Kaylor via 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

[clang] [CIR] Upstream proper function alias lowering (PR #150520)

2025-07-29 Thread Henrich Lauko via cfe-commits
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

[clang] [CIR] Upstream proper function alias lowering (PR #150520)

2025-07-25 Thread Henrich Lauko via 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

[clang] [CIR] Upstream proper function alias lowering (PR #150520)

2025-07-25 Thread Henrich Lauko via cfe-commits
@@ -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

[clang] [CIR] Upstream proper function alias lowering (PR #150520)

2025-07-25 Thread Henrich Lauko via cfe-commits
@@ -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

[clang] [CIR] Upstream proper function alias lowering (PR #150520)

2025-07-25 Thread Henrich Lauko via cfe-commits
@@ -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,

[clang] [CIR] Upstream proper function alias lowering (PR #150520)

2025-07-25 Thread Henrich Lauko via cfe-commits
@@ -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

[clang] [CIR] Upstream proper function alias lowering (PR #150520)

2025-07-25 Thread Henrich Lauko via cfe-commits
@@ -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

[clang] [CIR] Upstream proper function alias lowering (PR #150520)

2025-07-25 Thread Henrich Lauko via cfe-commits
@@ -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

[clang] [CIR] Upstream proper function alias lowering (PR #150520)

2025-07-25 Thread Henrich Lauko via cfe-commits
@@ -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

[clang] [CIR] Upstream proper function alias lowering (PR #150520)

2025-07-25 Thread Henrich Lauko via cfe-commits
@@ -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

[clang] [CIR] Upstream proper function alias lowering (PR #150520)

2025-07-25 Thread Henrich Lauko via cfe-commits
@@ -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

[clang] [CIR] Upstream proper function alias lowering (PR #150520)

2025-07-25 Thread Henrich Lauko via cfe-commits
@@ -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

[clang] [CIR] Upstream proper function alias lowering (PR #150520)

2025-07-24 Thread via cfe-commits
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

[clang] [CIR] Upstream proper function alias lowering (PR #150520)

2025-07-24 Thread Andy Kaylor via cfe-commits
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