https://github.com/erichkeane closed
https://github.com/llvm/llvm-project/pull/133405
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bcardosolopes approved this pull request.
https://github.com/llvm/llvm-project/pull/133405
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1294,6 +1296,90 @@ mlir::LogicalResult
CIRToLLVMCmpOpLowering::matchAndRewrite(
return mlir::success();
}
+mlir::LogicalResult CIRToLLVMShiftOpLowering::matchAndRewrite(
+cir::ShiftOp op, OpAdaptor adaptor,
+mlir::ConversionPatternRewriter &rewriter) const {
+
@@ -1294,6 +1296,90 @@ mlir::LogicalResult
CIRToLLVMCmpOpLowering::matchAndRewrite(
return mlir::success();
}
+mlir::LogicalResult CIRToLLVMShiftOpLowering::matchAndRewrite(
+cir::ShiftOp op, OpAdaptor adaptor,
+mlir::ConversionPatternRewriter &rewriter) const {
+
@@ -1294,6 +1296,90 @@ mlir::LogicalResult
CIRToLLVMCmpOpLowering::matchAndRewrite(
return mlir::success();
}
+mlir::LogicalResult CIRToLLVMShiftOpLowering::matchAndRewrite(
+cir::ShiftOp op, OpAdaptor adaptor,
+mlir::ConversionPatternRewriter &rewriter) const {
+
@@ -1294,6 +1296,90 @@ mlir::LogicalResult
CIRToLLVMCmpOpLowering::matchAndRewrite(
return mlir::success();
}
+mlir::LogicalResult CIRToLLVMShiftOpLowering::matchAndRewrite(
+cir::ShiftOp op, OpAdaptor adaptor,
+mlir::ConversionPatternRewriter &rewriter) const {
+
@@ -759,6 +762,46 @@ LogicalResult cir::BinOp::verify() {
return mlir::success();
}
+//===--===//
+// ShiftOp
+//===--===//
+LogicalResult
https://github.com/mmha updated https://github.com/llvm/llvm-project/pull/133405
>From 13833779faad62f95ef3fc0e2de3ed9b7c44d2f5 Mon Sep 17 00:00:00 2001
From: Morris Hafner
Date: Fri, 11 Apr 2025 17:46:00 +0200
Subject: [PATCH 1/2] [CIR] Upstream SelectOp and ShiftOp
Since SelectOp will only ge
@@ -1138,8 +1138,9 @@ mlir::Value ScalarExprEmitter::emitShl(const BinOpInfo
&ops) {
mlir::isa(ops.lhs.getType()))
cgf.cgm.errorNYI("sanitizers");
- cgf.cgm.errorNYI("shift ops");
- return {};
+ return builder.create(cgf.getLoc(ops.loc),
and
@@ -759,6 +762,46 @@ LogicalResult cir::BinOp::verify() {
return mlir::success();
}
+//===--===//
+// ShiftOp
+//===--===//
+LogicalResult
@@ -12,22 +16,307 @@ void b0(int a, int b) {
x = x | b;
}
-// CHECK: %{{.+}} = cir.binop(mul, %{{.+}}, %{{.+}}) nsw : !s32i
-// CHECK: %{{.+}} = cir.binop(div, %{{.+}}, %{{.+}}) : !s32i
-// CHECK: %{{.+}} = cir.binop(rem, %{{.+}}, %{{.+}}) : !s32i
-// CHECK: %{{.+}} = cir.bi
https://github.com/bcardosolopes requested changes to this pull request.
Looks reasonable to add vector support later for shifts. Because `SelectOp` is
independent of `ShiftOp`, one possibility would have been to split it in two
PRs to land them faster, but wouldn't bother changing for this rou
https://github.com/bcardosolopes edited
https://github.com/llvm/llvm-project/pull/133405
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1117,6 +1117,91 @@ mlir::LogicalResult
CIRToLLVMBinOpLowering::matchAndRewrite(
return mlir::LogicalResult::success();
}
+mlir::LogicalResult CIRToLLVMShiftOpLowering::matchAndRewrite(
+cir::ShiftOp op, OpAdaptor adaptor,
+mlir::ConversionPatternRewriter &rewrit
@@ -759,6 +762,46 @@ LogicalResult cir::BinOp::verify() {
return mlir::success();
}
+//===--===//
+// ShiftOp
+//===--===//
+LogicalResult
mmha wrote:
cc @andykaylor @erichkeane @dkolsen-pgi
https://github.com/llvm/llvm-project/pull/133405
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/mmha created https://github.com/llvm/llvm-project/pull/133405
Since SelectOp will only generated by a future pass that transforms a TernaryOp
this only includes the lowering bits.
This patch also improves the testing of the existing binary operators.
>From fc549133df0092c9c2
llvmbot wrote:
@llvm/pr-subscribers-clangir
Author: Morris Hafner (mmha)
Changes
Since SelectOp will only generated by a future pass that transforms a TernaryOp
this only includes the lowering bits.
This patch also improves the testing of the existing binary operators.
---
Patch is 28.
llvmbot wrote:
@llvm/pr-subscribers-clang
Author: Morris Hafner (mmha)
Changes
Since SelectOp will only generated by a future pass that transforms a TernaryOp
this only includes the lowering bits.
This patch also improves the testing of the existing binary operators.
---
Patch is 28.28
19 matches
Mail list logo