Documentation for microsoft::quantum::GroupingPass

microsoft::quantum::GroupingPass

More...

#include <Passes/GroupingPass/GroupingPass.hpp>

Inherits from llvm::PassInfoMixin< GroupingPass >

Public Classes

Name
struct ResourceAnalysis

Public Types

Name
enum class ResourceType { UNDEFINED, QUBIT, RESULT}
enum @1 { PureClassical = 0, SourceQuantum = 1, DestQuantum = 2, PureQuantum = SourceQuantum
using llvm::Instruction Instruction
using llvm::Value Value
using ILogger::ILoggerPtr ILoggerPtr
using std::unordered_set< llvm::BasicBlock * > BlockSet
using std::shared_ptr< llvm::IRBuilder<> > SharedBuilder

Public Functions

Name
GroupingPass(GroupingPassConfiguration const & cfg)
GroupingPass(GroupingPass const & )
Copy construction is banned.
GroupingPass(GroupingPass && ) =default
We allow move semantics.
~GroupingPass() =default
Default destruction.
void prepareSourceSeparation(llvm::Module & module, llvm::BasicBlock * block)
void nextQuantumCycle(llvm::Module & module, llvm::BasicBlock * block)
void expandBasedOnSource(llvm::Module & module, llvm::BasicBlock * block)
void expandBasedOnDest(llvm::Module & module, llvm::BasicBlock * block, bool move_quatum, String const & name)
bool isQuantumRegister(llvm::Type const * type)
int64_t classifyInstruction(llvm::Instruction const * instr)
llvm::PreservedAnalyses run(llvm::Module & module, llvm::ModuleAnalysisManager & mam)
void runBlockAnalysis(llvm::Module & module)
void setLogger(ILoggerPtr logger)
Sets the logger.
bool isRequired()
Whether or not this pass is required to run.

Detailed Description

class microsoft::quantum::GroupingPass;
┌─────────────────────────────────┐│┌──────────────────────────────────┐
│         No measurements         │││        With measurements         │
└─────────────────────────────────┘│└──────────────────────────────────┘
                                   │
     Before             After      │       Before            After
─────────────────┬─────────────────┼──────────────────┬─────────────────
                                   │
                         [entry]   │                          [entry]
                 │                 │                  │
                                   │                    ┌───
     [entry]                       │       [entry]      │
                 │ ┌───            │                  │ │  [bb head cc]
                   │               │                    │
                   │     [bb cc]   │                    │
                 │ │               │                  │ │     [bb qc]
  [mixed qc/cc]  ──▶               │  [mixed qc/mc/cc]──▶
                   │               │                    │
                 │ │     [bb qc]   │                  │ │     [bb mc]
                   │               │                    │
                   └───            │                    │
      [bb2]      │                 │        [bb2]     │ │  [bb tail cc]
                                   │                    │
                          [bb2]    │                    └───
                 │                 │                  │
                                   │                           [bb2]
                                   │

Public Types Documentation

enum ResourceType

Enumerator Value Description
UNDEFINED
QUBIT
RESULT

enum @1

Enumerator Value Description
PureClassical 0
SourceQuantum 1
DestQuantum 2
PureQuantum SourceQuantum DestQuantum
TransferClassicalToQuantum DestQuantum
TransferQuantumToClassical SourceQuantum
InvalidMixedLocation -1

using Instruction

using microsoft::quantum::GroupingPass::Instruction =  llvm::Instruction;

using Value

using microsoft::quantum::GroupingPass::Value =  llvm::Value;

using ILoggerPtr

using microsoft::quantum::GroupingPass::ILoggerPtr =  ILogger::ILoggerPtr;

using BlockSet

using microsoft::quantum::GroupingPass::BlockSet =  std::unordered_set<llvm::BasicBlock*>;

using SharedBuilder

using microsoft::quantum::GroupingPass::SharedBuilder =  std::shared_ptr<llvm::IRBuilder<> >;

Public Functions Documentation

function GroupingPass

inline explicit GroupingPass(
    GroupingPassConfiguration const & cfg
)

function GroupingPass

GroupingPass(
    GroupingPass const & 
)

Copy construction is banned.

function GroupingPass

GroupingPass(
    GroupingPass && 
) =default

We allow move semantics.

function ~GroupingPass

~GroupingPass() =default

Default destruction.

function prepareSourceSeparation

void prepareSourceSeparation(
    llvm::Module & module,
    llvm::BasicBlock * block
)

function nextQuantumCycle

void nextQuantumCycle(
    llvm::Module & module,
    llvm::BasicBlock * block
)

function expandBasedOnSource

void expandBasedOnSource(
    llvm::Module & module,
    llvm::BasicBlock * block
)

function expandBasedOnDest

void expandBasedOnDest(
    llvm::Module & module,
    llvm::BasicBlock * block,
    bool move_quatum,
    String const & name
)

function isQuantumRegister

bool isQuantumRegister(
    llvm::Type const * type
)

function classifyInstruction

int64_t classifyInstruction(
    llvm::Instruction const * instr
)

function run

llvm::PreservedAnalyses run(
    llvm::Module & module,
    llvm::ModuleAnalysisManager & mam
)

function runBlockAnalysis

void runBlockAnalysis(
    llvm::Module & module
)

function setLogger

void setLogger(
    ILoggerPtr logger
)

Sets the logger.

function isRequired

static bool isRequired()

Whether or not this pass is required to run.


Updated on 1 August 2023 at 16:25:10 UTC