[midend-LoopAnalysis]为phi指令添加新的方法供外部遍历(目前不是顺序遍历)

This commit is contained in:
rain2133
2025-08-08 00:55:01 +08:00
parent f083e38615
commit bd02f5f1eb

View File

@ -934,6 +934,14 @@ class PhiInst : public Instruction {
}
auto& getincomings() const {return blk2val;} ///< 获取所有的基本块和对应的值
auto getIncomingValues() const {
std::vector<std::pair<BasicBlock*, Value*>> result;
for (const auto& [block, value] : blk2val) {
result.emplace_back(block, value);
}
return result;
}
Value* getvalfromBlk(BasicBlock* blk) const ;
BasicBlock* getBlkfromVal(Value* val) const ;