Index: lib/Transforms/Scalar/GVN.cpp =================================================================== --- lib/Transforms/Scalar/GVN.cpp +++ lib/Transforms/Scalar/GVN.cpp @@ -71,6 +71,7 @@ static cl::opt EnablePRE("enable-pre", cl::init(true), cl::Hidden); static cl::opt EnableLoadPRE("enable-load-pre", cl::init(true)); +static cl::opt AggressiveLoadPRE("aggressive-load-pre", cl::init(false)); // Maximum allowed recursion depth. static cl::opt @@ -1083,7 +1084,7 @@ // FIXME: If we could restructure the CFG, we could make a common pred with // all the preds that don't have an available LI and insert a new load into // that one block. - if (NumUnavailablePreds != 1) + if (!AggressiveLoadPRE && NumUnavailablePreds != 1) return false; // Split critical edges, and update the unavailable predecessors accordingly.