Skip to content

Commit

Permalink
Fix handling cast without parameter (#328)
Browse files Browse the repository at this point in the history
  • Loading branch information
bcdonovan authored and reza-j committed May 20, 2024
1 parent 166b097 commit 7ac5f99
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/Conversion/QUIRToPulse/QUIRToPulse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,12 @@ mlir::Value QUIRToPulsePass::convertAngleToF64(Operation *angleOp,
paramCastOp->getLoc(), builder.getF64Type(), paramCastOp.getRes());
angleCastedOp->moveAfter(paramCastOp);
classicalQUIROpLocToConvertedPulseOpMap[angleLocHash] = angleCastedOp;
} else if (auto constOp =
dyn_cast<arith::ConstantOp>(castOpArg.getDefiningOp())) {
// if cast from float64 then use directly
assert(constOp.getType() == builder.getF64Type() &&
"expected angle type to be float 64");
classicalQUIROpLocToConvertedPulseOpMap[angleLocHash] = constOp;
} else
llvm_unreachable("castOp arg unknown");
} else
Expand Down

0 comments on commit 7ac5f99

Please sign in to comment.