Gergo Stomfai 0fb8f7f9c3
[DAG] Fold away identity FSHL and FSHR patterns (#185667)
Fold away identity FSHL and FSHR patterns

Came up in #185175, this seems to be the cleanest way to get rid of this
pattern

Alive2 proofs:
`fshl(lshr(x, amnt), shl(c, BW - amnt), amnt) -> x`:
✓ https://alive2.llvm.org/ce/z/AEzthY
`fshl(lshr(x, amnt), fshl(x, _, BW - amnt), amnt) -> x`:
✓ https://alive2.llvm.org/ce/z/oDpaqF
`fshl(lshr(x, amnt), fshr(x, _, amnt), amnt) -> x`:
✓ https://alive2.llvm.org/ce/z/aCxQch
`fshl(fshr(_, x, amnt), shl(c, BW - amnt), amnt) -> x`:
✓ https://alive2.llvm.org/ce/z/89NQME
`fshl(fshr(_, x, amnt), fshl(x, _, BW - amnt), amnt) -> x`:
✓ https://alive2.llvm.org/ce/z/KdR3Mp
`fshl(fshr(_, x, amnt), fshr(x, _, amnt), amnt) -> x`:
✓ https://alive2.llvm.org/ce/z/2Gkc7m
`fshl(fshl(_, x, BW - amnt), shl(c, BW - amnt), amnt) -> x`:
✓ https://alive2.llvm.org/ce/z/LNjr_R
`fshl(fshl(_, x, BW - amnt), fshl(x, _, BW - amnt), amnt) -> x`:
✓ https://alive2.llvm.org/ce/z/cwGjhL
`fshl(fshl(_, x, BW - amnt), fshr(x, _, amnt), amnt) -> x`:
✓ https://alive2.llvm.org/ce/z/UChZW4
`fshr(lshr(x, BW - amnt), shl(c, amnt), amnt) -> x`:
✓ https://alive2.llvm.org/ce/z/uiSBEQ
`fshr(lshr(x, BW - amnt), fshl(x, _, amnt), amnt) -> x`:
✓ https://alive2.llvm.org/ce/z/11pXpJ
`fshr(lshr(x, BW - amnt), fshr(x, _, BW - amnt), amnt) -> x`:
✓ https://alive2.llvm.org/ce/z/7mvxH7
`fshr(fshr(_, x, BW - amnt), shl(c, amnt), amnt) -> x`:
✓ https://alive2.llvm.org/ce/z/ybswip
`fshr(fshr(_, x, BW - amnt), fshl(x, _, amnt), amnt) -> x`:
✓ https://alive2.llvm.org/ce/z/fNUQQv
`fshr(fshr(_, x, BW - amnt), fshr(x, _, BW - amnt), amnt) -> x`:
✓ https://alive2.llvm.org/ce/z/9bFnec
`fshr(fshl(_, x, amnt), shl(c, amnt), amnt) -> x`:
✓ https://alive2.llvm.org/ce/z/vuYAYn
`fshr(fshl(_, x, amnt), fshl(x, _, amnt), amnt) -> x`:
✓ https://alive2.llvm.org/ce/z/kP94MG
`fshr(fshl(_, x, amnt), fshr(x, _, BW - amnt), amnt) -> x`:
✓ https://alive2.llvm.org/ce/z/X8u__v
2026-03-12 11:21:29 +00:00
..
2026-02-06 17:11:15 -08:00