public static void PreInstrument(GPUVerifier verifier, Implementation impl)
        {
            foreach (var region in verifier.RootRegion(impl).SubRegions())
            {
                if (verifier.RegionHasLoopInvariantsDisabled(region))
                {
                    continue;
                }

                GenerateCandidateForReducedStrengthStrideVariables(verifier, impl, region);
                GenerateCandidateForNonNegativeGuardVariables(verifier, impl, region);
                GenerateCandidateForNonUniformGuardVariables(verifier, impl, region);
                GenerateCandidateForLoopBounds(verifier, impl, region);
                GenerateCandidateForEnabledness(verifier, impl, region);
                GenerateCandidateForEnablednessWhenAccessingSharedArrays(verifier, impl, region);
            }
        }
        private void AddCandidateInvariants(HashSet <Variable> localVars, Implementation impl)
        {
            foreach (IRegion region in verifier.RootRegion(impl).SubRegions())
            {
                if (verifier.RegionHasLoopInvariantsDisabled(region))
                {
                    continue;
                }

                foreach (InvariantGenerationRule r in invariantGenerationRules)
                {
                    r.GenerateCandidates(impl, region);
                }

                AddBarrierDivergenceCandidates(localVars, impl, region);

                verifier.RaceInstrumenter.AddRaceCheckingCandidateInvariants(impl, region);
            }
        }