about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-08-08 13:33:53 +0000
committerbors <bors@rust-lang.org>2020-08-08 13:33:53 +0000
commit2bac92bba14f3b260b337d2a51c77c0780456e65 (patch)
tree92e808c9d9a93e2423dd62fd12eaa2165b9b6ac2 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parentc989ac132a81503ceaaa1054da0a3a8c5c305ef0 (diff)
parent7e5c7cf8e32d43b1c7fca06effbc7739634c31a0 (diff)
downloadrust-2bac92bba14f3b260b337d2a51c77c0780456e65.tar.gz
rust-2bac92bba14f3b260b337d2a51c77c0780456e65.zip
Auto merge of #74533 - nikic:issue-74425, r=eddyb
Emit == null instead of <= null for niche check

When the niche maximum is zero, emit a "== zero" check instead of a "<= zero" check. In particular, this avoids the awkward case of "<= null". While LLVM does canonicalize this to "== null", this apparently 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