Skip to content

Commit e1be532

Browse files
authored
Merge pull request #42448 from eeckstein/fix-benchmark-build
Fix benchmark build+run
2 parents 0a9f7d9 + 1fceeab commit e1be532

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

benchmark/scripts/run_smoke_bench

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -307,11 +307,12 @@ def report_code_size(opt_level, old_dir, new_dir, architecture, platform, output
307307

308308

309309
def get_codesize(filename):
310-
output = subprocess.check_output(["size", filename]).splitlines()
311-
header_line = output[0]
312-
data_line = output[1]
310+
output = subprocess.check_output(["size", filename])
311+
lines = output.decode('utf-8').splitlines()
312+
header_line = lines[0]
313+
data_line = lines[1]
313314
if header_line.find("__TEXT") != 0:
314-
sys.exit("unexpected output from size command:\n" + output)
315+
sys.exit("unexpected output from size command:\n" + lines)
315316
return int(data_line.split("\t")[0])
316317

317318

@@ -361,7 +362,8 @@ performance team (@eeckstein).
361362
<summary><strong>Hardware Overview</strong></summary>
362363
363364
"""
364-
po = subprocess.check_output(["system_profiler", "SPHardwareDataType"])
365+
output = subprocess.check_output(["system_profiler", "SPHardwareDataType"])
366+
po = output.decode('utf-8')
365367
for line in po.splitlines():
366368
selection = [
367369
"Model Name",

benchmark/utils/TestsUtils.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,11 +324,13 @@ public func someProtocolFactory() -> SomeProtocol { return MyStruct() }
324324
// It's important that this function is in another module than the tests
325325
// which are using it.
326326
@inline(never)
327+
@_semantics("optimize.no.crossmodule")
327328
public func blackHole<T>(_ x: T) {
328329
}
329330

330331
// Return the passed argument without letting the optimizer know that.
331332
@inline(never)
333+
@_semantics("optimize.no.crossmodule")
332334
public func identity<T>(_ x: T) -> T {
333335
return x
334336
}
@@ -337,12 +339,15 @@ public func identity<T>(_ x: T) -> T {
337339
// It's important that this function is in another module than the tests
338340
// which are using it.
339341
@inline(never)
342+
@_semantics("optimize.no.crossmodule")
340343
public func getInt(_ x: Int) -> Int { return x }
341344

342345
// The same for String.
343346
@inline(never)
347+
@_semantics("optimize.no.crossmodule")
344348
public func getString(_ s: String) -> String { return s }
345349

346350
// The same for Substring.
347351
@inline(never)
352+
@_semantics("optimize.no.crossmodule")
348353
public func getSubstring(_ s: Substring) -> Substring { return s }

0 commit comments

Comments
 (0)