Skip to content

Commit 00085bd

Browse files
committed
Disable C2 from using AVX-512 on JDK 10 (#32138)
The C2 compiler in JDK 10 appears to have an issue compiling to AVX-512 instructions (on hardware that supports such). As a workaround, this commit adds a JVM flag on JDK 10+ to disable the use of AVX-512 instructions until a fix is introduced to the JDK. Instead, we use a flag to enable AVX and AVX2 only. Note: Based on my reading of the C2 code, this flag does not appear to have any impact on hardware that does not support AVX2. I have tested this manually on an Intel Atom C2538 processor that supports neither AVX nor AVX2. I have also tested this manually on an Intel i5-3317U processor that supports AVX but not AVX2.
1 parent bb2f59a commit 00085bd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

distribution/src/config/jvm.options

+3
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,6 @@ ${error.file}
100100
# due to internationalization enhancements in JDK 9 Elasticsearch need to set the provider to COMPAT otherwise
101101
# time/date parsing will break in an incompatible way for some date patterns and locals
102102
9-:-Djava.locale.providers=COMPAT
103+
104+
# temporary workaround for C2 bug with JDK 10 on hardware with AVX-512
105+
10-:-XX:UseAVX=2

0 commit comments

Comments
 (0)