From 2af2837c363deaed0b2faa91a1a73ab41aaefe1b Mon Sep 17 00:00:00 2001 From: Brian Donovan Date: Fri, 17 May 2024 09:48:01 -0400 Subject: [PATCH] Fix handling cast without parameter --- lib/Conversion/QUIRToPulse/QUIRToPulse.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/Conversion/QUIRToPulse/QUIRToPulse.cpp b/lib/Conversion/QUIRToPulse/QUIRToPulse.cpp index af865b07b..8b65fc517 100644 --- a/lib/Conversion/QUIRToPulse/QUIRToPulse.cpp +++ b/lib/Conversion/QUIRToPulse/QUIRToPulse.cpp @@ -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(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