[Mlir-commits] [mlir] [mlir][emitc] Lower arith.index_cast, arith.index_castui, arith.shli, arith.shrui, arith.shrsi (PR #95795)

Simon Camphausen llvmlistbot at llvm.org
Wed Jul 3 02:58:53 PDT 2024


================
@@ -482,6 +507,90 @@ class BitwiseOpConversion : public OpConversionPattern<ArithOp> {
   }
 };
 
+template <typename ArithOp, typename EmitCOp, bool isUnsignedOp>
+class ShiftOpConversion : public OpConversionPattern<ArithOp> {
+public:
+  using OpConversionPattern<ArithOp>::OpConversionPattern;
+
+  LogicalResult
+  matchAndRewrite(ArithOp op, typename ArithOp::Adaptor adaptor,
+                  ConversionPatternRewriter &rewriter) const override {
+
+    Type type = this->getTypeConverter()->convertType(op.getType());
+    if (!type || !(isa_and_nonnull<IntegerType>(type) ||
----------------
simon-camp wrote:

`isa<IntegerType>`

https://github.com/llvm/llvm-project/pull/95795


More information about the Mlir-commits mailing list