Workaround for ReactorUnitTests.LargeStack taking too long on LLVM
Disable the InstructionCombiningPass and O2 optimization level to make
ReactorUnitTests.LargeStack take only a few seconds to run. Otherwise,
it would take 6 minutes on my desktop workstation.
Bug: b/174031014
Change-Id: I88fb240fe1ba6dcf822a8ff70bb595a4c3f3aa01
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/50710
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Antonio Maiorano <amaiorano@google.com>
diff --git a/tests/ReactorUnitTests/ReactorUnitTests.cpp b/tests/ReactorUnitTests/ReactorUnitTests.cpp
index e66611b..fbe61ec 100644
--- a/tests/ReactorUnitTests/ReactorUnitTests.cpp
+++ b/tests/ReactorUnitTests/ReactorUnitTests.cpp
@@ -1280,7 +1280,15 @@
}
}
- auto routine = function("one");
+ // LLVM takes very long to generate this routine when InstructionCombining
+ // and O2 optimizations are enabled. Disable for now.
+ // TODO(b/174031014): Remove this once we fix LLVM taking so long
+ auto cfg = Config::Edit{}
+ .remove(Optimization::Pass::InstructionCombining)
+ .set(Optimization::Level::None);
+
+ auto routine = function(cfg, "one");
+
std::array<int32_t, ArraySize> v;
// Run this in a thread, so that we get the default reserved stack size (8K on Win64).