@@ -103,7 +103,7 @@ def getBOLTCmakeBuildFactory(
103
103
boltOld = "bin/llvm-bolt.old"
104
104
105
105
f .addSteps ([
106
- # Cleanup binaries and markers from previous NFC-mode runs.
106
+ # Cleanup old/new binaries and markers from previous NFC-mode runs.
107
107
ShellCommand (
108
108
name = 'clean-nfc-check' ,
109
109
command = (
@@ -114,7 +114,9 @@ def getBOLTCmakeBuildFactory(
114
114
haltOnFailure = False ,
115
115
flunkOnFailure = False ,
116
116
env = env ),
117
- # Build the current and previous revision of llvm-bolt.
117
+ # Build the current and previous revision of llvm-bolt as
118
+ # llvm-bolt.new and llvm-bolt.old. Also, creates a marker to force
119
+ # in-tree tests in case additional source code changes are detected.
118
120
ShellCommand (
119
121
name = 'nfc-check-setup' ,
120
122
command = [
@@ -130,6 +132,18 @@ def getBOLTCmakeBuildFactory(
130
132
haltOnFailure = False ,
131
133
flunkOnFailure = False ,
132
134
env = env ),
135
+ # Verify that the llvm-bolt binary can report its version within a
136
+ # reasonable amount of time.
137
+ ShellCommand (
138
+ name = 'llvm-bolt-version-check' ,
139
+ command = (f"{ boltNew } --version" ),
140
+ description = ('Check that llvm-bolt binary passes a simple test'
141
+ 'before proceeding with testing.' ),
142
+ descriptionDone = ["llvm-bolt --version" ],
143
+ haltOnFailure = True ,
144
+ flunkOnFailure = True ,
145
+ maxTime = 30 ,
146
+ env = env ),
133
147
# Validate that NFC-mode comparison is meaningful by checking:
134
148
# - the old and new binaries exist
135
149
# - no unique IDs are embedded in the binaries
@@ -154,6 +168,7 @@ def getBOLTCmakeBuildFactory(
154
168
haltOnFailure = False ,
155
169
warnOnFailure = True ,
156
170
warnOnWarnings = True ,
171
+ maxTime = 30 ,
157
172
decodeRC = {0 : SUCCESS , 1 : FAILURE , 2 : WARNINGS },
158
173
descriptionDone = ["NFC-Mode Validation" ],
159
174
env = env ),
@@ -174,10 +189,12 @@ def getBOLTCmakeBuildFactory(
174
189
haltOnFailure = False ,
175
190
env = env ),
176
191
# Run in-tree tests if the llvm-bolt binary has changed, or if
177
- # relevant source code changes are detected.
192
+ # relevant source code changes are detected. Lower scheduling
193
+ # priority with nice to reduce CPU contention in virtualized
194
+ # environments. This step relinks the llvm-bolt binary if needed.
178
195
LitTestCommand (
179
196
name = 'nfc-check-bolt' ,
180
- command = [ " ninja" , " check-bolt"] ,
197
+ command = ( "nice -n 5 ninja check-bolt") ,
181
198
description = ["running" , "NFC" , "check-bolt" ],
182
199
descriptionDone = ["NFC" , "check-bolt" , "completed" ],
183
200
warnOnFailure = True ,
@@ -186,10 +203,10 @@ def getBOLTCmakeBuildFactory(
186
203
doStepIf = FileDoesNotExist (f"build/{ skipInTree } " ),
187
204
env = env ),
188
205
# Run out-of-tree large tests if the llvm-bolt binary has changed.
206
+ # Lower scheduling priority, as above.
189
207
LitTestCommand (
190
208
name = 'nfc-check-large-bolt' ,
191
- command = ['bin/llvm-lit' , '-sv' , '-j2' ,
192
- 'tools/bolttests' ],
209
+ command = ('nice -n 5 bin/llvm-lit -v -j2 tools/bolttests' ),
193
210
description = ["running" , "NFC" , "check-large-bolt" ],
194
211
descriptionDone = ["NFC" , "check-large-bolt" , "completed" ],
195
212
warnOnFailure = True ,
0 commit comments