1
Fork 0
rust/compiler/rustc_codegen_ssa/src
bors b2728d5426 Auto merge of #135674 - scottmcm:assume-better, r=estebank
Update our range `assume`s to the format that LLVM prefers

I found out in https://github.com/llvm/llvm-project/issues/123278#issuecomment-2597440158 that the way I started emitting the `assume`s in #109993 was suboptimal, and as seen in that LLVM issue the way we're doing it -- with two `assume`s sometimes -- can at times lead to CVP/SCCP not realize what's happening because one of them turns into a `ne` instead of conveying a range.

So this updates how it's emitted from
```
assume( x >= LOW );
assume( x <= HIGH );
```
or
```
// (for ranges that wrap the range)
assume( (x <= LOW) | (x >= HIGH) );
```
to
```
assume( (x - LOW) <= (HIGH - LOW) );
```
so that we don't need multiple `icmp`s nor multiple `assume`s for a single value, and both wrappping and non-wrapping ranges emit the same shape.

(And we don't bother emitting the subtraction if `LOW` is zero, since that's trivial for us to check too.)
2025-01-22 04:18:30 +00:00
..
back Fix emscripten-wasm-eh with unwind=abort 2025-01-13 23:34:06 +01:00
debuginfo Begin to implement type system layer of unsafe binders 2024-12-22 21:57:57 +00:00
mir Auto merge of #135674 - scottmcm:assume-better, r=estebank 2025-01-22 04:18:30 +00:00
traits Auto merge of #135674 - scottmcm:assume-better, r=estebank 2025-01-22 04:18:30 +00:00
assert_module_sources.rs Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
base.rs remove support for the #[start] attribute 2025-01-21 06:59:15 -07:00
codegen_attrs.rs Treat safe target_feature functions as unsafe by default 2025-01-15 08:58:17 +00:00
common.rs Test fixing raw-dylib 2024-09-24 10:10:31 -07:00
errors.rs don't show the full linker args unless --verbose is passed 2024-12-14 20:38:46 -05:00
lib.rs Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
meth.rs compiler: Directly use rustc_abi in codegen 2024-11-03 12:30:32 -08:00
mono_item.rs codegen #[naked] functions using global_asm! 2024-12-10 21:41:03 +01:00
size_of_val.rs compiler: Directly use rustc_abi in codegen 2024-11-03 12:30:32 -08:00
target_features.rs add dedicated type for ABI target feature constraints 2025-01-05 10:46:30 +01:00