Index: lib/Transforms/Scalar/GVNHoist.cpp =================================================================== --- lib/Transforms/Scalar/GVNHoist.cpp +++ lib/Transforms/Scalar/GVNHoist.cpp @@ -766,6 +766,8 @@ } bool runOnFunction(Function &F) override { + if (skipFunction(F)) + return false; auto &DT = getAnalysis().getDomTree(); auto &AA = getAnalysis().getAAResults(); auto &MD = getAnalysis().getMemDep(); Index: test/Feature/optnone-opt.ll =================================================================== --- test/Feature/optnone-opt.ll +++ test/Feature/optnone-opt.ll @@ -41,6 +41,7 @@ ; OPT-O1-DAG: Skipping pass 'Combine redundant instructions' ; OPT-O1-DAG: Skipping pass 'Dead Store Elimination' ; OPT-O1-DAG: Skipping pass 'Early CSE' +; OPT-O1-DAG: Skipping pass 'Early GVN Hoisting of Expressions' ; OPT-O1-DAG: Skipping pass 'Jump Threading' ; OPT-O1-DAG: Skipping pass 'MemCpy Optimization' ; OPT-O1-DAG: Skipping pass 'Reassociate expressions'