Explorar el Código

Replace uses of phi which has same operand for all path with the operand. (#115)

Xiang Li hace 8 años
padre
commit
d5dbc051f3
Se han modificado 1 ficheros con 4 adiciones y 2 borrados
  1. 4 2
      lib/HLSL/DxilGenerationPass.cpp

+ 4 - 2
lib/HLSL/DxilGenerationPass.cpp

@@ -1916,10 +1916,12 @@ void DxilGenerationPass::AddCreateHandleForPhiNode(std::unordered_map<Instructio
     }
 
     if (resClass0) {
-      handlePhi->setArgOperand(DXIL::OperandIndex::kCreateHandleResClassOpIdx, resClass0);
+      resClassPhi->replaceAllUsesWith(resClass0);
+      resClassPhi->eraseFromParent();
     }
     if (resID0) {
-      handlePhi->setArgOperand(DXIL::OperandIndex::kCreateHandleResIDOpIdx, resID0);
+      resIDPhi->replaceAllUsesWith(resID0);
+      resIDPhi->eraseFromParent();
     }
   }