Skip to content

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

Description

@regehr
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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions