summary refs log tree commit diff stats
path: root/results/scraper/fex/1791
diff options
context:
space:
mode:
Diffstat (limited to 'results/scraper/fex/1791')
-rw-r--r--results/scraper/fex/179126
1 files changed, 26 insertions, 0 deletions
diff --git a/results/scraper/fex/1791 b/results/scraper/fex/1791
new file mode 100644
index 000000000..8c882dd38
--- /dev/null
+++ b/results/scraper/fex/1791
@@ -0,0 +1,26 @@
+Aggressive spilling when initializing large unordered_maps
+While working on #1760, I hit an interesting edge case in our JIT: Initializing large `std::unordered_map`s (>3000 entries) causes the JIT to spill a lot of registers, but only if the running application was compiled with optimizations enabled.

+

+Steps to reproduce:

+1. Write a list of all libGL functions to `mylist.inl` using

+```

+<FEX-build-folder>/Bin/thunkgen ThunkLibs/libGL/libGL_interface.cpp libGL -symbol_list mylist.inl -- -std=c++17 -isystem ThunkLibs/include/

+```

+2. Create a new file called `test.cpp` with these contents:

+```cpp

+#include <cstdint>

+#include <unordered_map>

+#include <string_view>

+#include "mylist.inl"

+

+static std::unordered_map<std::string_view, uintptr_t> HostPtrInvokers{};

+

+int main() {

+#define PAIR(name, unused) { #name, 0 },

+  HostPtrInvokers = {

+    FOREACH_internal_SYMBOL(PAIR)

+  };

+}

+```

+3. Compile for x86-64 using `x86_64-linux-gnu-g++ -O0 test.cpp`. Running the output binary in FEX should quickly finish.

+4. Compile for x86-64 using `x86_64-linux-gnu-g++ -O2 test.cpp`. This optimized binary takes several seconds to run in FEX