From 8f70b848d339cabfaa8f1379d41dae11b9b75014 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Thu, 29 Dec 2022 23:25:22 -0800 Subject: [PATCH] [CodeGen] Temporarily disable-lsr in HWASAN build HWASAN exposes some non-determinism in the pass and triggers: ScalarEvolution.cpp:11540: bool llvm::ScalarEvolution::isLoopEntryGuardedByCond(const Loop *, ICmpInst::Predicate, const SCEV *, const SCEV *): Assertion `isAvailableAtLoopEntry(LHS, L) && "LHS is not available at Loop Entry"' failed. E.g. https://lab.llvm.org/buildbot/#/builders/236/builds/1629/steps/16/logs/stdio is broken after D137838. I tried to split D137838 into smaller patches and the one which reproduced was just a move of cpp from one dir to another. Maybe it has something do to with comparison of tagged pointeres and PtrSets used in pass. Issues is hard to reproduce, even slight changes in path, or preprocessing cpp file hide it. --- llvm/lib/CodeGen/TargetPassConfig.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/llvm/lib/CodeGen/TargetPassConfig.cpp b/llvm/lib/CodeGen/TargetPassConfig.cpp index 115f266..9bf3215 100644 --- a/llvm/lib/CodeGen/TargetPassConfig.cpp +++ b/llvm/lib/CodeGen/TargetPassConfig.cpp @@ -89,8 +89,12 @@ static cl::opt DisableMachineSink("disable-machine-sink", cl::Hidden, static cl::opt DisablePostRAMachineSink("disable-postra-machine-sink", cl::Hidden, cl::desc("Disable PostRA Machine Sinking")); -static cl::opt DisableLSR("disable-lsr", cl::Hidden, - cl::desc("Disable Loop Strength Reduction Pass")); +static cl::opt + DisableLSR("disable-lsr", cl::Hidden, + cl::desc("Disable Loop Strength Reduction Pass"), + // FIXME: Investigate and re-enable. HWASAN exposes some + // non-determinism in the pass. + cl::init(LLVM_HWADDRESS_SANITIZER_BUILD)); static cl::opt DisableConstantHoisting("disable-constant-hoisting", cl::Hidden, cl::desc("Disable ConstantHoisting")); static cl::opt DisableCGP("disable-cgp", cl::Hidden, -- 2.7.4