summaryrefslogtreecommitdiff
path: root/tests/rustdoc-js-std/parser-errors.js
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-04-14 21:54:56 +0000
committerbors <bors@rust-lang.org>2023-04-14 21:54:56 +0000
commit158c30951383afb9cee7eba14d152eb7b198a910 (patch)
treeb06561d7258ce152a9fe560a6fa6ee3c0ad3d05e /tests/rustdoc-js-std/parser-errors.js
parent84dd17b56a931a631a23dfd5ef2018fd3ef49108 (diff)
parenta8857d2fe153717e428742f6a8537abbe6793c50 (diff)
downloadrust-158c30951383afb9cee7eba14d152eb7b198a910.tar.gz
Auto merge of #110197 - cjgillot:codegen-discr, r=pnkfelix
Do not attempt to commute comparison and cast to codegen discriminants The general algorithm to compute a discriminant is: ``` relative_tag = tag - niche_start is_niche = relative_tag <= (ule) relative_max discr = if is_niche { cast(relative_tag) + niche_variants.start() } else { untagged_variant } ``` We have an optimization branch which attempts to merge the addition and the subtraction by commuting them with the cast. We currently get this optimization wrong. This PR takes the easiest and safest way: remove the optimization, and let LLVM handle it. (Perf may not agree with that course of action :sweat_smile:) There may be a less invasive solution, but I don't have the necessary knowledge of LLVM semantics to find it. Cranelift has the same optimization, which should be handled similarly. cc `@nikic` and `@bjorn3` if you have a better solution. Fixes https://github.com/rust-lang/rust/issues/110128
Diffstat (limited to 'tests/rustdoc-js-std/parser-errors.js')
0 files changed, 0 insertions, 0 deletions