[clang] [CIR] Upstream SelectOp and ShiftOp (PR #133405)

2025-03-31 Thread Andy Kaylor via cfe-commits
@@ -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

[clang] [CIR] Upstream SelectOp and ShiftOp (PR #133405)

2025-03-31 Thread Andy Kaylor via cfe-commits
@@ -759,6 +762,46 @@ LogicalResult cir::BinOp::verify() { return mlir::success(); } +//===--===// +// ShiftOp +//===--===// +LogicalResult

[clang] [CIR] Upstream SelectOp and ShiftOp (PR #133405)

2025-03-31 Thread Andy Kaylor via cfe-commits
@@ -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

[clang] [CIR] Upstream SelectOp and ShiftOp (PR #133405)

2025-03-29 Thread Bruno Cardoso Lopes via cfe-commits
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

[clang] [CIR] Upstream SelectOp and ShiftOp (PR #133405)

2025-03-28 Thread Bruno Cardoso Lopes via cfe-commits
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

[clang] [CIR] Upstream SelectOp and ShiftOp (PR #133405)

2025-03-28 Thread Bruno Cardoso Lopes via 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

[clang] [CIR] Upstream SelectOp and ShiftOp (PR #133405)

2025-03-28 Thread Bruno Cardoso Lopes via cfe-commits
@@ -759,6 +762,46 @@ LogicalResult cir::BinOp::verify() { return mlir::success(); } +//===--===// +// ShiftOp +//===--===// +LogicalResult

[clang] [CIR] Upstream SelectOp and ShiftOp (PR #133405)

2025-03-28 Thread Morris Hafner via cfe-commits
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

[clang] [CIR] Upstream SelectOp and ShiftOp (PR #133405)

2025-03-28 Thread Morris Hafner via 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

[clang] [CIR] Upstream SelectOp and ShiftOp (PR #133405)

2025-03-28 Thread via cfe-commits
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.

[clang] [CIR] Upstream SelectOp and ShiftOp (PR #133405)

2025-03-28 Thread via cfe-commits
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