HomePhabricator

[lld][ELF] Add --shuffle-sections=seed to shuffle input sections

Authored by espindola on Feb 19 2020, 1:19 PM.

Description

[lld][ELF] Add --shuffle-sections=seed to shuffle input sections

Summary:
This option causes lld to shuffle sections by assigning different
priorities in each run.

The use case for this is to introduce randomization in benchmarks. The
idea is inspired by the paper "Producing Wrong Data Without Doing
Anything Obviously Wrong!"
(https://www.inf.usi.ch/faculty/hauswirth/publications/asplos09.pdf). Unlike
the paper, we shuffle individual sections, not just input files.

Doing this in lld is particularly convenient as the --reproduce option
makes it easy to collect all the necessary bits for relinking the
program being benchmarked. Once that it is done, all that is needed is
to add --shuffle-sections=0 to the response file and relink before each
run of the benchmark.

Differential Revision: https://reviews.llvm.org/D74791

Details

Committed
MaskRayFeb 19 2020, 1:44 PM
Differential Revision
D74791: Add a --shuffle-sections=seed option to lld
Parents
rG03954a12aecb: [AMDGPU] Fix DS_WRITE_B32 patterns
Branches
Unknown
Tags
Unknown