about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-09-01 10:54:56 +0000
committerbors <bors@rust-lang.org>2023-09-01 10:54:56 +0000
commitf4555ef5e14e8f0630fc5ad4e8efaef56d4acd4b (patch)
treeeffb3c6b2888a0468816146264748f65c46d9407 /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
parentd6b4d35d5e94f6a1577e0e645fb23afc84615a6c (diff)
parent67553e8a11837c4b18657eedfcc272057e532bad (diff)
downloadrust-f4555ef5e14e8f0630fc5ad4e8efaef56d4acd4b.tar.gz
rust-f4555ef5e14e8f0630fc5ad4e8efaef56d4acd4b.zip
Auto merge of #111752 - dingxiangfei2009:lower-or-pattern, r=cjgillot
Lower `Or` pattern without allocating place

cc `@azizghuloum` `@cjgillot`

Related to #111583 and #111644

While reviewing #111644, it occurs to me that while we directly lower conjunctive predicates, which are connected with `&&`, into the desirable control flow, today we don't directly lower the disjunctive predicates, which are connected with `||`, in the similar fashion. Instead, we allocate a place for the boolean temporary to hold the result of evaluating the `||` expression.

Usually I would expect optimization at later stages to "inline" the evaluation of boolean predicates into simple CFG, but #111583 is an example where `&&` is failing to be optimized away and the assembly shows that both the expensive operands are evaluated. Therefore, I would like to make a small change to make the CFG a bit more straight-forward without invoking the `as_temp` machinery, and plus avoid allocating the place to hold the boolean result as well.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions