about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-07-19 20:57:49 +0200
committerNikita Popov <nikita.ppv@gmail.com>2020-08-08 10:45:15 +0200
commit7e5c7cf8e32d43b1c7fca06effbc7739634c31a0 (patch)
tree15a021d8fa46a081f691c52a6f84fa3847266452 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parent48036804d2bc461b243c5d291b850e44bcca68ef (diff)
downloadrust-7e5c7cf8e32d43b1c7fca06effbc7739634c31a0.tar.gz
rust-7e5c7cf8e32d43b1c7fca06effbc7739634c31a0.zip
Emit == null instead of <= null
When the niche maximum is zero, emit a "== zero" check instead of
a "<= zero" check. In particular, this avoid the awkward case of
"<= null". While LLVM does canonicalize this to "!= null", this
appently doesn't happen for constant expressions, leading to the
issue in #74425. While that can be addressed on the LLVM side, it
still seems prudent to emit sensible IR here, because this will
allow null checks to be optimized earlier in the pipeline.

Fixes #74425.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions