[flang-commits] [flang] [flang] Add definition of hlfir.cmpchar operation. (PR #155457)
Valery Dmitriev via flang-commits
flang-commits at lists.llvm.org
Wed Aug 27 08:07:22 PDT 2025
================
@@ -820,6 +820,40 @@ void hlfir::ConcatOp::getEffects(
getIntrinsicEffects(getOperation(), effects);
}
+//===----------------------------------------------------------------------===//
+// CmpCharOp
+//===----------------------------------------------------------------------===//
+
+llvm::LogicalResult hlfir::CmpCharOp::verify() {
+ mlir::Value lchr = getLchr();
+ mlir::Value rchr = getRchr();
+
+ unsigned kind = getCharacterKind(lchr.getType());
+ if (kind != getCharacterKind(rchr.getType()))
+ return emitOpError("character arguments must have the same KIND");
+
+ switch (getPredicate()) {
+ case mlir::arith::CmpIPredicate::slt:
+ case mlir::arith::CmpIPredicate::sle:
+ case mlir::arith::CmpIPredicate::eq:
+ case mlir::arith::CmpIPredicate::ne:
+ case mlir::arith::CmpIPredicate::sgt:
+ case mlir::arith::CmpIPredicate::sge:
----------------
valerydmit wrote:
Thank you, Tom. I added it.
https://github.com/llvm/llvm-project/pull/155457
More information about the flang-commits
mailing list