[llvm] [EarlyCSE] Fix improper icmp simplification (PR #122043)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 8 01:04:36 PST 2025


dtcxzyw wrote:

> > > In actual testing, no matter if % 4 is set to null in a multithreaded environment, it seems that there is no running problem when calling _ZN1A5valueEv. Due to optimizations, %4 == null cannot be intercepted.
> > 
> > 
> > Can you share the C source code via godbolt?
> > This is the source code link.: https://github.com/openjdk/jdk8u/blob/master/hotspot/src/share/vm/runtime/synchronizer.cpp
> > Function: ObjectSynchronizer::inflate

Sorry, I don't have enough bandwidth to provide a reproducer. All I can tell is that EarlyCSE is correct in https://godbolt.org/z/chhxE3Txr. But I am not sure if the source code contains UB, or there is a pass that misoptimizes the program before EarlyCSE. You can rebuild hotspot with ubsan. After confirming that it is a compiler bug, please file an issue to track this.



https://github.com/llvm/llvm-project/pull/122043


More information about the llvm-commits mailing list