Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set --enable-circuits default to true #327

Merged
merged 4 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/Conversion/QUIRToPulse/QUIRToPulse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,13 +207,15 @@ QUIRToPulsePass::convertCircuitToSequence(CallCircuitOp &callCircuitOp,
auto durOpConstantOp = callCircuitOp.getOperand(argNum)
.getDefiningOp<mlir::quir::ConstantOp>();
auto durOp = quir::getDuration(durOpConstantOp).get();
durValue = static_cast<uint>(durOp.getDuration().convertToDouble());
durValue =
static_cast<uint64_t>(durOp.getDuration().convertToDouble());
assert(durOp.getType().dyn_cast<DurationType>().getUnits() ==
TimeUnits::dt &&
"this pass only accepts durations with dt unit");
} else {
auto durOp = quir::getDuration(delayOp).get();
durValue = static_cast<uint>(durOp.getDuration().convertToDouble());
durValue =
static_cast<uint64_t>(durOp.getDuration().convertToDouble());
assert(durOp.getType().dyn_cast<DurationType>().getUnits() ==
TimeUnits::dt &&
"this pass only accepts durations with dt unit");
Expand Down
4 changes: 2 additions & 2 deletions lib/Dialect/Pulse/Transforms/Scheduling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void QuantumCircuitPulseSchedulingPass::scheduleAlap(
std::string const sequenceName = quantumCircuitSequenceOp.getSymName().str();
LLVM_DEBUG(llvm::dbgs() << "\nscheduling " << sequenceName << "\n");

int totalDurationOfQuantumCircuitNegative = 0;
int64_t totalDurationOfQuantumCircuitNegative = 0;
mixFrameToNextAvailabilityMap.clear();

// get the MLIR block of the quantum circuit
Expand Down Expand Up @@ -166,7 +166,7 @@ void QuantumCircuitPulseSchedulingPass::scheduleAlap(
}

// multiply by -1 so that quantum circuit duration becomes positive
const int totalDurationOfQuantumCircuit =
const int64_t totalDurationOfQuantumCircuit =
-totalDurationOfQuantumCircuitNegative;
LLVM_DEBUG(llvm::dbgs() << "\ttotal duration of quantum circuit "
<< totalDurationOfQuantumCircuit << "\n");
Expand Down
2 changes: 1 addition & 1 deletion lib/Dialect/QUIR/Transforms/ExtractCircuits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ using namespace mlir::quir;
llvm::cl::opt<bool>
enableCircuits("enable-circuits",
llvm::cl::desc("enable extract quir circuits"),
llvm::cl::init(false));
llvm::cl::init(true));

static bool terminatesCircuit(Operation &op) {
return (op.hasTrait<::mlir::RegionBranchOpInterface::Trait>() ||
Expand Down
Loading