search for: fshl

Displaying 4 results from an estimated 4 matches for "fshl".

2019 Feb 25
3
funnel shift, select, and poison
We have these transforms from funnel shift to a simpler shift op: // fshl(X, 0, C) -> shl X, C // fshl(X, undef, C) -> shl X, C // fshl(0, X, C) -> lshr X, (BW-C) // fshl(undef, X, C) -> lshr X, (BW-C) These were part of: https://reviews.llvm.org/D54778 In all cases, one operand must be 0 or undef and the shift amount is a constant, so I t...
2019 Feb 25
2
funnel shift, select, and poison
Don't we need to distinguish funnel shift from the more specific rotate? I'm not seeing how rotate (a single input op shifted by some amount) gets into trouble like funnel shift (two variables concatenated and shifted by some amount). Eg, if in pseudo IR we have: %funnel_shift = fshl %x, %y, %sh ; this is problematic because either x or y can be poison, but we may not touch the poison when sh==0 %rotate = fshl %x, %x, %sh ; if x is poison, the op is unquestionably producing poison; there's no sh==0 loophole here On Mon, Feb 25, 2019 at 1:12 PM Nuno Lopes <nunoplopes at...
2019 Feb 26
2
funnel shift, select, and poison
...fts, the funnel shifts mask the shift exponent. This removes > potential UBs but also introduces an impedance mismatch WRT shift.) > > John > > > On 2/25/19 4:17 PM, Sanjay Patel wrote: > > We have these transforms from funnel shift to a simpler shift op: > > // fshl(X, 0, C) -> shl X, C > > // fshl(X, undef, C) -> shl X, C > > // fshl(0, X, C) -> lshr X, (BW-C) > > // fshl(undef, X, C) -> lshr X, (BW-C) > > > > These were part of: https://reviews.llvm.org/D54778 > > > > In all cases, on...
2019 Feb 25
4
funnel shift, select, and poison
There's a question about the behavior of funnel shift [1] + select and poison here that reminds me of previous discussions about select and poison [2]: https://github.com/AliveToolkit/alive2/pull/32#discussion_r257528880 Example: define i8 @fshl_zero_shift_guard(i8 %x, i8 %y, i8 %sh) { %c = icmp eq i8 %sh, 0 %f = fshl i8 %x, i8 %y, i8 %sh %s = select i1 %c, i8 %x, i8 %f ; shift amount is 0 returns x (same as fshl) ret i8 %s } => define i8 @fshl_zero_shift_guard(i8 %x, i8 %y, i8 %sh) { %f = fshl i8 %x, i8 %y, i8 %sh ret i8 %f } Transform...