Skip to content

Commit cf2ebf4

Browse files
committed
[SemanticARCOpts] Always heed subpass flags.
To get equivalent test coverage in asserts and noasserts builds, enable the code that triggers executing only specified subpasses in noasserts builds. rdar://154499140
1 parent 2253697 commit cf2ebf4

File tree

4 files changed

+0
-16
lines changed

4 files changed

+0
-16
lines changed

lib/SILOptimizer/SemanticARC/Context.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -129,16 +129,9 @@ struct LLVM_LIBRARY_VISIBILITY Context {
129129
void verify() const;
130130

131131
bool shouldPerform(ARCTransformKind testKind) const {
132-
// When asserts are enabled, we allow for specific arc transforms to be
133-
// turned on/off via LLVM args. So check that if we have asserts, perform
134-
// all optimizations otherwise.
135-
#ifndef NDEBUG
136132
if (transformKind == ARCTransformKind::Invalid)
137133
return false;
138134
return bool(testKind & transformKind);
139-
#else
140-
return true;
141-
#endif
142135
}
143136

144137
void reset() {

lib/SILOptimizer/SemanticARC/SemanticARCOpts.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ struct SemanticARCOpts : SILFunctionTransform {
7777
SemanticARCOpts(bool mandatoryOptsOnly)
7878
: mandatoryOptsOnly(mandatoryOptsOnly) {}
7979

80-
#ifndef NDEBUG
8180
void performCommandlineSpecifiedTransforms(SemanticARCOptVisitor &visitor) {
8281
for (auto transform : TransformsToPerform) {
8382
visitor.ctx.transformKind = transform;
@@ -110,7 +109,6 @@ struct SemanticARCOpts : SILFunctionTransform {
110109
}
111110
}
112111
}
113-
#endif
114112

115113
bool performPeepholesWithoutFixedPoint(SemanticARCOptVisitor &visitor) {
116114
// Add all the results of all instructions that we want to visit to the
@@ -162,13 +160,11 @@ struct SemanticARCOpts : SILFunctionTransform {
162160
SemanticARCOptVisitor visitor(f, getPassManager(), *deBlocksAnalysis->get(&f),
163161
mandatoryOptsOnly);
164162

165-
#ifndef NDEBUG
166163
// If we are being asked for testing purposes to run a series of transforms
167164
// expressed on the command line, run that and return.
168165
if (!TransformsToPerform.empty()) {
169166
return performCommandlineSpecifiedTransforms(visitor);
170167
}
171-
#endif
172168

173169
// Otherwise, perform our standard optimizations.
174170
bool didEliminateARCInsts = performPeepholes(visitor);

test/SILOptimizer/semantic-arc-opt-unchecked-ownership-conversion.sil

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// RUN: %target-sil-opt -module-name Swift -enable-sil-verify-all -semantic-arc-opts -sil-semantic-arc-peepholes-ownership-conversion-elim -sil-semantic-arc-peepholes-lifetime-joining %s | %FileCheck %s
22

3-
// REQUIRES: asserts
4-
53
sil_stage canonical
64

75
import Builtin

test/SILOptimizer/semantic-arc-opts-lifetime-joining.sil

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
// RUN: %target-sil-opt -sil-print-types -module-name Swift -enable-sil-verify-all -semantic-arc-opts -sil-semantic-arc-peepholes-lifetime-joining %s | %FileCheck %s
2-
//
3-
// Enabling specific ARC opts requires an asserts build.
4-
// REQUIRES: asserts
52

63
// NOTE: Some of our tests here depend on borrow elimination /not/ running!
74
// Please do not add it to clean up the IR like we did in

0 commit comments

Comments
 (0)