KhronosGroup / KhronosGroup/SPIRV-Tools

Implement an operand iterator for Phi instructions.

Open
#966 0 comments 0 reactions 1 assignee Claimed by @dnovillo View on GitHub
component:optimization enhancement
Dominant language
C++
Stars
1.4k
Forks
709
Avg merge
1d 22h
Merged PRs (30d)
28

Description

Phi instructions have many operands that are unrelated to the abstract idea of a Phi node.

The first two operands are the result and the type. The remaining operands come in pairs, one representing the actual operand (a result ID), the other representing the block label that the result ID is flowing through.

Ideally, we should be able to have accessors for these elements:

- ir::Instruction::PhiResult: Returns the resulting id.
- ir::Instruction::PhiType: Returns the type.
- ir::Instruction::PhiArg(i): Returns the result id for operand #i
- ir::Instruction::PhiBlock(i): Returns the block label for the operand #i.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.