[clang] [CIR] Update ComplexImagOp to work on scalar type (PR #161571)

Bruno Cardoso Lopes via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 3 12:07:14 PDT 2025


================
@@ -2418,14 +2418,22 @@ OpFoldResult cir::ComplexRealOp::fold(FoldAdaptor adaptor) {
 //===----------------------------------------------------------------------===//
 
 LogicalResult cir::ComplexImagOp::verify() {
-  if (getType() != getOperand().getType().getElementType()) {
+  mlir::Type operandTy = getOperand().getType();
+  if (auto complexOperandTy = mlir::dyn_cast<cir::ComplexType>(operandTy)) {
----------------
bcardosolopes wrote:

no curlies needed here

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


More information about the cfe-commits mailing list