[CodeGen] Temporarily disable-lsr in HWASAN build
authorVitaly Buka <vitalybuka@google.com>
Fri, 30 Dec 2022 07:25:22 +0000 (23:25 -0800)
committerVitaly Buka <vitalybuka@google.com>
Fri, 30 Dec 2022 07:37:49 +0000 (23:37 -0800)
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

index 115f266..9bf3215 100644 (file)
@@ -89,8 +89,12 @@ static cl::opt<bool> DisableMachineSink("disable-machine-sink", cl::Hidden,
 static cl::opt<bool> DisablePostRAMachineSink("disable-postra-machine-sink",
     cl::Hidden,
     cl::desc("Disable PostRA Machine Sinking"));
-static cl::opt<bool> DisableLSR("disable-lsr", cl::Hidden,
-    cl::desc("Disable Loop Strength Reduction Pass"));
+static cl::opt<bool>
+    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<bool> DisableConstantHoisting("disable-constant-hoisting",
     cl::Hidden, cl::desc("Disable ConstantHoisting"));
 static cl::opt<bool> DisableCGP("disable-cgp", cl::Hidden,