Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

miscompile of non-canonical add+icmp by arm64 backend #55627

Closed
regehr opened this issue May 21, 2022 · 4 comments
Closed

miscompile of non-canonical add+icmp by arm64 backend #55627

regehr opened this issue May 21, 2022 · 4 comments

Comments

@regehr
Copy link
Contributor

regehr commented May 21, 2022

define i1 @f() {
  %1 = add i8 0, 159
  %2 = icmp ugt i8 243, %1
  ret i1 %2
}

this clearly needs to compile to something emitting true (a few other backends I tried do this) but using top of tree this is what we get from the arm64 backend:

regehr@john-home:~$ llc --march=aarch64 foo.ll -o -
	.text
	.file	"foo.ll"
	.globl	f                               // -- Begin function f
	.p2align	2
	.type	f,@function
f:                                      // @f
	.cfi_startproc
// %bb.0:
	mov	w0, wzr
	ret
.Lfunc_end0:
	.size	f, .Lfunc_end0-f
	.cfi_endproc
                                        // -- End function
	.section	".note.GNU-stack","",@progbits
regehr@john-home:~$ 

cc @ornata @nunoplopes @ryan-berger @nbushehri @zhengyang92 @aqjune @Hatsunespica

@llvmbot
Copy link
Member

llvmbot commented May 21, 2022

@llvm/issue-subscribers-backend-aarch64

@topperc
Copy link
Collaborator

topperc commented May 21, 2022

Any chance this is fixed by https://reviews.llvm.org/D125654

@topperc
Copy link
Collaborator

topperc commented May 21, 2022

Fixed by 4638766

@topperc topperc closed this as completed May 21, 2022
@regehr
Copy link
Contributor Author

regehr commented May 21, 2022

ah you beat me to it, I was just compiling that :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants