Skip to content
Commit 3ca55d9c authored by Craig Topper's avatar Craig Topper
Browse files

Avoid undefined behavior in the x86 lzcnt header file by explicitly checking...

Avoid undefined behavior in the x86 lzcnt header file by explicitly checking for 0 before calling __builtin_clz. Without this the optimizers may take advantage of the undefined behavior and produce incorrect results. LLVM itself still needs to be taught to merge the zero check into the llvm.ctlz with defined zero behavior.

llvm-svn: 221064
parent 3411c3ea
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment