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

            Bug ID: 43222
           Summary: [SimplifyCFG] produces incorrect callbr's
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Transformation Utilities
          Assignee: unassignedb...@nondot.org
          Reporter: ndesaulni...@google.com
                CC: craig.top...@gmail.com, llvm-bugs@lists.llvm.org,
                    natechancel...@gmail.com, srhi...@google.com
            Blocks: 4068

Created attachment 22471
  --> https://bugs.llvm.org/attachment.cgi?id=22471&action=edit
z.ll

With the attached test case, and new verifier check from
(https://reviews.llvm.org/D67196) I observe a failure in SimplifyCFG:

$ opt --simplifycfg z.ll -o /dev/null
Indirect label missing from arglist.
  callbr void asm sideeffect "// XXX: ${0:l}", "X"(i8* blockaddress(@andy_test,
%if.then))
          to label %land.rhs.i [label %if.end]
in function andy_test
LLVM ERROR: Broken function found, compilation aborted!

the indirect label list `[label %if.end]`.

Attaching z2.ll, which is the post-simplyifycfg-ed version that violates the
invariant.

Looks like a simple phi is being replaced:

branch_test.exit:                                 ; preds = %entry, %land.rhs.i
  %0 = phi i1 [ true, %entry ], [ false, %land.rhs.i ]
  br i1 %0, label %if.end, label %if.then

where the blockaddress of %if.then is being updated correctly, but the indirect
label list is not.


Referenced Bugs:

https://bugs.llvm.org/show_bug.cgi?id=4068
[Bug 4068] [Meta] Compiling the Linux kernel with clang
-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to