HomePhabricator

Make SwitchInstProfUpdateWrapper safer

Description

Make SwitchInstProfUpdateWrapper safer

While prof branch_weights inconsistencies are being fixed patch
by patch (pass by pass) we need SwitchInstProfUpdateWrapper to
be safe with respect to inconsistent metadata that can come from
passes that have not been fixed yet. See the bug found by @nikic
in https://reviews.llvm.org/D62126.

This patch introduces one more state (called Invalid) to the
wrapper class that allows users to work with the underlying
SwitchInst ignoring the prof metadata changes.

Created a unit test for the SwitchInstProfUpdateWrapper class.

Reviewers: davidx, nikic, eraman, reames, chandlerc
Reviewed By: davidx
Differential Revision: https://reviews.llvm.org/D62656

Details

Committed
yroubanJun 4 2019, 2:03 AM
Differential Revision
D62656: Make SwitchInstProfUpdateWrapper safer
Parents
rL362472: [DAGCombine] Match a pattern where a wide type scalar value is stored by…
Branches
Unknown
Tags
Unknown