diff options
author | Clement Courbet <courbet@google.com> | 2019-06-26 12:13:13 +0000 |
---|---|---|
committer | Clement Courbet <courbet@google.com> | 2019-06-26 12:13:13 +0000 |
commit | 2851248fa14119a59f9262ae91fb2c06baa59ea3 (patch) | |
tree | eb9cc180117046c412d19a2161ac656926425337 /llvm/lib/CodeGen/TargetPassConfig.cpp | |
parent | aa999528966781ae84e508b5a29cc4be7ea0368f (diff) | |
download | bcm5719-llvm-2851248fa14119a59f9262ae91fb2c06baa59ea3.tar.gz bcm5719-llvm-2851248fa14119a59f9262ae91fb2c06baa59ea3.zip |
Revert "r364412 [ExpandMemCmp][MergeICmps] Move passes out of CodeGen into opt pipeline."
Breaks sanitizers:
libFuzzer :: cxxstring.test
libFuzzer :: memcmp.test
libFuzzer :: recommended-dictionary.test
libFuzzer :: strcmp.test
libFuzzer :: value-profile-mem.test
libFuzzer :: value-profile-strcmp.test
llvm-svn: 364416
Diffstat (limited to 'llvm/lib/CodeGen/TargetPassConfig.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TargetPassConfig.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/TargetPassConfig.cpp b/llvm/lib/CodeGen/TargetPassConfig.cpp index 7f1189fec3c..98b4742be1c 100644 --- a/llvm/lib/CodeGen/TargetPassConfig.cpp +++ b/llvm/lib/CodeGen/TargetPassConfig.cpp @@ -99,6 +99,9 @@ static cl::opt<bool> EnableImplicitNullChecks( "enable-implicit-null-checks", cl::desc("Fold null checks into faulting memory operations"), cl::init(false), cl::Hidden); +static cl::opt<bool> DisableMergeICmps("disable-mergeicmps", + cl::desc("Disable MergeICmps Pass"), + cl::init(false), cl::Hidden); static cl::opt<bool> PrintLSR("print-lsr-output", cl::Hidden, cl::desc("Print LLVM IR produced by the loop-reduce pass")); static cl::opt<bool> PrintISelInput("print-isel-input", cl::Hidden, @@ -637,6 +640,16 @@ void TargetPassConfig::addIRPasses() { addPass(createPrintFunctionPass(dbgs(), "\n\n*** Code after LSR ***\n")); } + if (getOptLevel() != CodeGenOpt::None) { + // The MergeICmpsPass tries to create memcmp calls by grouping sequences of + // loads and compares. ExpandMemCmpPass then tries to expand those calls + // into optimally-sized loads and compares. The transforms are enabled by a + // target lowering hook. + if (!DisableMergeICmps) + addPass(createMergeICmpsLegacyPass()); + addPass(createExpandMemCmpPass()); + } + // Run GC lowering passes for builtin collectors // TODO: add a pass insertion point here addPass(createGCLoweringPass()); |