Issue 55484
Summary miscompile from multiple backends
Labels backend:AArch64, llvm:codegen, miscompilation
Assignees
Reporter regehr
    here's a function:
```llvm
define i32 @f(i32 %0) {
  %2 = lshr i32 %0, 8
  %3 = shl i32 %0, 8
  %4 = or i32 %2, %3
  %5 = trunc i32 %4 to i16
  %6 = sext i16 %5 to i32
  ret i32 %6
}
```

we believe that `f(0x00800000) -> ffff8000` but the top-of-tree arm64, x86, and x86-64 backends are all emitting code which says that `f(0x00800000) -> 0`

```console
Johns-MacBook-Pro:~ regehr$ llc -o - foo.ll
	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 12, 0
	.globl	_f                              ; -- Begin function f
	.p2align	2
_f:                                     ; @f
	.cfi_startproc
; %bb.0:
	rev	w8, w0
	asr	w0, w8, #16
	ret
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
Johns-MacBook-Pro:~ regehr$ 
```

cc @ornata @nunoplopes @ryan-berger @nbushehri @zhengyang92 @aqjune @Hatsunespica
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to