Skip to content

[X86][FastISel] with.overflow eflags clobber #48931

@nikic

Description

@nikic
Bugzilla Link 49587
Resolution FIXED
Resolved on Mar 31, 2021 01:54
Version trunk
OS Linux
Blocks #48246
CC @topperc,@RKSimon,@phoebewang,@rotateright,@tstellar
Fixed by commit(s) 0d814ca 7669455 79a79d1 38dd45b

Extended Description

define i32 @​test(i64 %arg) nounwind {
entry:
%usubo = tail call { i64, i1 } @​llvm.usub.with.overflow.i64(i64 %arg, i64 1)
%overflow = extractvalue { i64, i1 } %usubo, 1
br i1 %overflow, label %merge, label %no_overflow

no_overflow:
br label %merge

merge:
%phi = phi i32 [ 1, %no_overflow ], [ 0, %entry ]
ret i32 %phi
}

declare { i64, i1 } @​llvm.usub.with.overflow.i64(i64, i64)

; RUN: llc -O0 < %s

test: # @​test

%bb.0: # %entry

subq	$1, %rdi setb	%al xorl	%eax, %eax movl	%eax, -4(%rsp) # 4-byte Spill jb	.LBB0_2 

%bb.1: # %no_overflow

movl	$1, %eax movl	%eax, -4(%rsp) # 4-byte Spill jmp	.LBB0_2 

.LBB0_2: # %merge
movl -4(%rsp), %eax # 4-byte Reload
retq

xorl clobbers eflags from subq, used by jb.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions