File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -288,6 +288,10 @@ bool TargetTransformInfo::hasBranchDivergence(const Function *F) const {
288288}
289289
290290bool TargetTransformInfo::isSourceOfDivergence (const Value *V) const {
291+ if (auto Call = dyn_cast<CallBase>(V)) {
292+ if (Call->hasFnAttr (Attribute::NoDivergenceSource))
293+ return false ;
294+ }
291295 return TTIImpl->isSourceOfDivergence (V);
292296}
293297
Original file line number Diff line number Diff line change @@ -32,10 +32,7 @@ bool llvm::GenericUniformityAnalysisImpl<SSAContext>::markDefsDivergent(
3232
3333template <> void llvm::GenericUniformityAnalysisImpl<SSAContext>::initialize() {
3434 for (auto &I : instructions (F)) {
35- bool NoDivergenceSource = false ;
36- if (auto Call = dyn_cast<CallBase>(&I))
37- NoDivergenceSource = Call->hasFnAttr (Attribute::NoDivergenceSource);
38- if (!NoDivergenceSource && TTI->isSourceOfDivergence (&I))
35+ if (TTI->isSourceOfDivergence (&I))
3936 markDivergent (I);
4037 else if (TTI->isAlwaysUniform (&I))
4138 addUniformOverride (I);
You can’t perform that action at this time.
0 commit comments