[llvm-bugs] [Bug 27500] New: [MSP430] codegen: strange branch instructions

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Apr 24 04:11:51 PDT 2016


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

            Bug ID: 27500
           Summary: [MSP430] codegen: strange branch instructions
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: MSP430
          Assignee: unassignedbugs at nondot.org
          Reporter: pftbest at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 16256
  --> https://llvm.org/bugs/attachment.cgi?id=16256&action=edit
original.ll (does not trigger error)

When original.ll is optimized with `opt -O3` then llc generates strange
conditional branch instructions that look like this:

.LBB0_4:                                ; %if.then26
    cmp.b    #126, r7
    jne    4
    br    #.LBB0_57
.LBB0_5:                                ; %cond.end38
    mov.w    #1, r13
    mov.b    r7, r6
    and.b    #63, r6

"jne 4" instruction is then compiled by gcc into "jnz $+6" and in result we are
jumping over "mov.w #1, r13".

steps to reproduce:
$ opt -O3 original.ll -o optimized.bc
$ llc optimized.bc -o optimized.s
$ cat optimized.s | grep 'j.*\t4'
    jne    4
    jne    4

software versions:
(http://llvm.org/git/llvm.git 822155bcb5ae5fc09d4448b862758631c9378a3b)
LLVM (http://llvm.org/):
  LLVM version 3.9.0svn
  DEBUG build with assertions.
  Built Apr 24 2016 (08:41:34).
  Default target: x86_64-apple-darwin15.4.0
  Host CPU: haswell

-- 
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/20160424/73628f56/attachment-0001.html>


More information about the llvm-bugs mailing list