(cfg, branchBlock)
| 305 | } |
| 306 | |
| 307 | initializeLoopVariable(cfg, branchBlock) { |
| 308 | CFG.pushBlock(cfg, branchBlock); |
| 309 | let initialVar = this.initialCb(); |
| 310 | |
| 311 | // Convert to StrandsNode if it's not already one |
| 312 | if (!(initialVar?.isStrandsNode)) { |
| 313 | const { id, dimension } = primitiveConstructorNode(this.strandsContext, { baseType: BaseType.FLOAT, dimension: 1 }, initialVar); |
| 314 | initialVar = createStrandsNode(id, dimension, this.strandsContext); |
| 315 | } |
| 316 | |
| 317 | // Create phi node for the loop variable in the BRANCH block |
| 318 | const phiNode = createPhiNode(this.strandsContext, [ |
| 319 | { value: initialVar, blockId: branchBlock }, |
| 320 | { value: initialVar, blockId: branchBlock } // Placeholder, will be updated later |
| 321 | ], 'loopVar'); |
| 322 | CFG.popBlock(cfg); |
| 323 | |
| 324 | return { initialVar, phiNode }; |
| 325 | } |
| 326 | |
| 327 | createLogicalNotNode(conditionNode) { |
| 328 | const notOperationNode = DAG.createNodeData({ |
no test coverage detected