|
116 | 116 | using namespace llvm;
|
117 | 117 |
|
118 | 118 | static cl::opt<bool> VerifyNoAliasScopeDomination(
|
119 |
| - "verify-noalias-scope-decl-dom", cl::Hidden, cl::init(false), |
| 119 | + "verify-noalias-scope-decl-dom", cl::Hidden, cl::init(true), |
120 | 120 | cl::desc("Ensure that llvm.experimental.noalias.scope.decl for identical "
|
121 | 121 | "scopes are not dominating"));
|
122 | 122 |
|
@@ -5587,18 +5587,17 @@ void Verifier::verifyNoAliasScopeDecl() {
|
5587 | 5587 | } while (ItNext != NoAliasScopeDecls.end() &&
|
5588 | 5588 | GetScope(*ItNext) == CurScope);
|
5589 | 5589 |
|
5590 |
| - // [ItCurrent, ItNext[ represents the declarations for the same scope. |
5591 |
| - // Ensure they are not dominating each other |
5592 |
| - for (auto *I : llvm::make_range(ItCurrent, ItNext)) { |
5593 |
| - for (auto *J : llvm::make_range(ItCurrent, ItNext)) { |
5594 |
| - if (I != J) { |
5595 |
| - Assert(!DT.dominates(I, J), |
5596 |
| - "llvm.experimental.noalias.scope.decl dominates another one " |
5597 |
| - "with the same scope", |
5598 |
| - I); |
5599 |
| - } |
5600 |
| - } |
5601 |
| - } |
| 5590 | + // [ItCurrent, ItNext) represents the declarations for the same scope. |
| 5591 | + // Ensure they are not dominating each other.. but only if it is not too |
| 5592 | + // expensive. |
| 5593 | + if (ItNext - ItCurrent < 32) |
| 5594 | + for (auto *I : llvm::make_range(ItCurrent, ItNext)) |
| 5595 | + for (auto *J : llvm::make_range(ItCurrent, ItNext)) |
| 5596 | + if (I != J) |
| 5597 | + Assert(!DT.dominates(I, J), |
| 5598 | + "llvm.experimental.noalias.scope.decl dominates another one " |
| 5599 | + "with the same scope", |
| 5600 | + I); |
5602 | 5601 | ItCurrent = ItNext;
|
5603 | 5602 | }
|
5604 | 5603 | }
|
|
0 commit comments