Hendrik =?utf-8?q?Hübner?Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/[email protected]>
================
@@ -1362,6 +1346,60 @@ mlir::LogicalResult
CIRToLLVMPtrStrideOpLowering::matchAndRewrite(
return mlir::success();
}
+static std::string getThreeWayCmpIntrinsicName(bool signedCmp,
+ unsigned operandWidth,
+ unsigned resultWidth) {
+ // The intrinsic's name takes the form:
+ // `llvm.<scmp|ucmp>.i<resultWidth>.i<operandWidth>`
+
+ std::string result = "llvm.";
+
+ if (signedCmp)
+ result.append("scmp.");
+ else
+ result.append("ucmp.");
+
+ // Result type part.
+ result.push_back('i');
+ result.append(std::to_string(resultWidth));
+ result.push_back('.');
+
+ // Operand type part.
+ result.push_back('i');
+ result.append(std::to_string(operandWidth));
+
+ return result;
+}
+
+mlir::LogicalResult CIRToLLVMCmpThreeWayOpLowering::matchAndRewrite(
----------------
andykaylor wrote:
`LoweringPrepare` must be run before we attempt to lower CIR to the LLVM
dialect, and if `LoweringPrepare` has been run, it will execute on every
`ThreeWayCmpOp`. Standard error reporting will handle any cases missed (for
instance, if `LoweringPrepare` wasn't run).
https://github.com/llvm/llvm-project/pull/169963
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits