[flang-commits] [flang] [flang] Add definition of hlfir.cmpchar operation. (PR #155457)
Tom Eccles via flang-commits
flang-commits at lists.llvm.org
Wed Aug 27 09:22:20 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:
----------------
tblah wrote:
Oh okay my mistake. Thanks for the clarification Slava. @valerydmit please feel free to remove these.
https://github.com/llvm/llvm-project/pull/155457
More information about the flang-commits
mailing list