[clang] [CIR] Update ComplexRealOp to work on scalar type (PR #161080)
Henrich Lauko via cfe-commits
cfe-commits at lists.llvm.org
Sun Sep 28 23:50:06 PDT 2025
================
@@ -2302,14 +2302,23 @@ OpFoldResult cir::ComplexCreateOp::fold(FoldAdaptor adaptor) {
//===----------------------------------------------------------------------===//
LogicalResult cir::ComplexRealOp::verify() {
- if (getType() != getOperand().getType().getElementType()) {
+ mlir::Type operandTy = getOperand().getType();
+ if (mlir::isa<cir::ComplexType>(operandTy)) {
+ operandTy = mlir::cast<cir::ComplexType>(operandTy).getElementType();
+ }
----------------
xlauko wrote:
```suggestion
if (auto complexOperandTy = mlir::dyn_cast<cir::ComplexType>(operandTy)) {
operandTy = complexOperandTy.getElementType();
}
```
https://github.com/llvm/llvm-project/pull/161080
More information about the cfe-commits
mailing list