Issue 179494
Summary AMDGPU fails to form BFE with 16-bit patterns
Labels backend:AMDGPU, missed-optimization
Assignees
Reporter arsenm
    These functions should be able to equivalently use v_bfe_u32, but the 16-bit version does not:

https://godbolt.org/z/n5EG4Mh3z
```
; v_bfe_u32 v0, v0, 4, 4
define i32 @bfe_32(i32 %a) {
  %shr.i = lshr i32 %a, 4
  %and = and i32 %shr.i, 15
  ret i32 %and
}

; v_lshrrev_b16_e32 v0, 4, v0
; v_and_b32_e32 v0, 15, v0
define i16 @bfe_16(i16 %a) {
  %shr.i = lshr i16 %a, 4
  %and = and i16 %shr.i, 15
  ret i16 %and
}

```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to