The EnablePRE flag is responsible for controlling access to both the BlockRPONumber map and to the routine that uses the map (performScalarPRE). While investigating an issue, it became apparent that there is a path to performScalarPRE that does not check the EnablePRE flag, and in that case we cannot guarantee BlockRPONumber is populated correctly. This patch introduces a guard along the path that accesses performScalarPRE.
This patch is based on a discussion at: https://reviews.llvm.org/D55974