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

Conditional branch to target MachineBasicBlock failed #60

Open
aaronsm opened this issue Jan 30, 2020 · 0 comments
Open

Conditional branch to target MachineBasicBlock failed #60

aaronsm opened this issue Jan 30, 2020 · 0 comments

Comments

@aaronsm
Copy link
Contributor

aaronsm commented Jan 30, 2020

Assembly from X86 coremark:

  400d31: 49 8b 5d 00                   movq    (%r13), %rbx
  400d35: 48 85 db                      testq   %rbx, %rbx
  400d38: 74 21                         je      33 <core_bench_list+0x59b>
  400d3a: 66 0f 1f 44 00 00             nopw    (%rax,%rax)
  400d40: 49 8b 45 08                   movq    8(%r13), %rax
  400d44: 0f bf 38                      movswl  (%rax), %edi
  400d47: 41 0f b7 f7                   movzwl  %r15w, %esi
  400d4b: e8 c0 29 00 00                callq   10688 <crc16>
  400d50: 41 89 c7                      movl    %eax, %r15d
  400d53: 48 8b 1b                      movq    (%rbx), %rbx
  400d56: 48 85 db                      testq   %rbx, %rbx
  400d59: 75 e5                         jne     -27 <core_bench_list+0x580>
  400d5b: 44 89 f8                      movl    %r15d, %eax
  400d5e: 48 83 c4 38                   addq    $56, %rsp
  400d62: 5b                            popq    %rbx
  400d63: 41 5c                         popq    %r12
  400d65: 41 5d                         popq    %r13
  400d67: 41 5e                         popq    %r14
  400d69: 41 5f                         popq    %r15
  400d6b: 5d                            popq    %rbp
  400d6c: c3                            retq

Dump from llvm-mctoll:

bb.113:
; predecessors: %bb.80
  successors: %bb.116, %bb.114, %bb.115

  $rbx = MOV64rm $r13, 1, $noreg, 0, $noreg, <0x55e9aeab55c8>
  TEST64rr $rbx, $rbx, <0x55e9aeab56e8>, implicit-def $eflags
  JCC_1 33, 4, <0x55e9aeab5808>, implicit $eflags

bb.114:
; predecessors: %bb.113


bb.115:
; predecessors: %bb.115, %bb.113
  successors: %bb.115, %bb.116

  $rax = MOV64rm $r13, 1, $noreg, 8, $noreg, <0x55e9aeab5ba8>
  $edi = MOVSX32rm16 $rax, 1, $noreg, 0, $noreg, <0x55e9aeab5cc8>
  $esi = MOVZX32rr16 $r15w, <0x55e9aeab5de8>
  CALL64pcrel32 10688, <0x55e9aeab5f08>, implicit $rsp, implicit $ssp
  $r15d = MOV32rr $eax, <0x55e9aeab6028>
  $rbx = MOV64rm $rbx, 1, $noreg, 0, $noreg, <0x55e9aeab6148>
  TEST64rr $rbx, $rbx, <0x55e9aeab6268>, implicit-def $eflags
  JCC_1 -27, 5, <0x55e9aeab6388>, implicit $eflags

The else branch target MBB of the conditional branch of JE is bb.114, but bb.114 is empty. This should jump to bb.115.

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

No branches or pull requests

1 participant