Răsfoiți Sursa

Correct WaveSensitivity debug test iterations (#3562)

Instead of verifying that the args of an known phi were not known to be
sensitive, it was checking the users, which can very well be wave
sensitive
Greg Roth 4 ani în urmă
părinte
comite
094b1087ab
1 a modificat fișierele cu 5 adăugiri și 3 ștergeri
  1. 5 3
      lib/HLSL/WaveSensitivityAnalysis.cpp

+ 5 - 3
lib/HLSL/WaveSensitivityAnalysis.cpp

@@ -111,9 +111,11 @@ void WaveSensitivityAnalyzer::Analyze(Function *F) {
           }
         }
 #ifndef NDEBUG
-        for (User *U : Phi->users()) {
-          Instruction *UI = cast<Instruction>(U);
-          DXASSERT_LOCALVAR(UI, GetInstState(UI) != KnownSensitive, "Unknown wave-status Phi argument should not be able to be known sensitive");
+        for (unsigned i = 0; i < Phi->getNumIncomingValues(); i++) {
+          if (Instruction *IArg = dyn_cast<Instruction>(Phi->getIncomingValue(i))) {
+            DXASSERT_LOCALVAR(IArg, GetInstState(IArg) != KnownSensitive,
+                   "Unknown wave-status Phi argument should not be able to be known sensitive");
+          }
         }
 #endif
         if (allPredsVisited)