[llvm-bugs] [Bug 49587] New: [X86][FastISel] with.overflow eflags clobber

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Mar 14 08:16:27 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=49587

            Bug ID: 49587
           Summary: [X86][FastISel] with.overflow eflags clobber
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: nikita.ppv at gmail.com
                CC: craig.topper at gmail.com, llvm-bugs at lists.llvm.org,
                    llvm-dev at redking.me.uk, pengfei.wang at intel.com,
                    spatel+llvm at rotateright.com
            Blocks: 48902

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.


Referenced Bugs:

https://bugs.llvm.org/show_bug.cgi?id=48902
[Bug 48902] [meta] 12.0.0 Release Blockers
-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210314/d2ced775/attachment.html>


More information about the llvm-bugs mailing list