[llvm-bugs] [Bug 49195] New: [CFGOpt] Instruction does not dominate all uses!

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Feb 15 10:08:45 PST 2021


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

            Bug ID: 49195
           Summary: [CFGOpt]    Instruction does not dominate all uses!
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: paulsson at linux.vnet.ibm.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 24530
  --> https://bugs.llvm.org/attachment.cgi?id=24530&action=edit
reduced testcase

clang -O3 -march=z10 crash10_aftercreduce.c -o a.out -w -mllvm
-bonus-inst-threshold=2

Instruction does not dominate all uses!
  %3 = load i32, i32* @a, align 4
  store i32 %3, i32* %1, align 4, !tbaa !2
Instruction does not dominate all uses!
  %5 = load i32, i32* @a, align 4
  store i32 %5, i32* %1, align 4, !tbaa !2
Instruction does not dominate all uses!
  %7 = load i32, i32* @a, align 4
  store i32 %7, i32* %1, align 4, !tbaa !2
Instruction does not dominate all uses!
  %9 = load i32, i32* @a, align 4
  store i32 %9, i32* %1, align 4, !tbaa !2


*** IR Dump After Combine redundant instructions ***
; Function Attrs: nofree noinline norecurse nounwind
define dso_local void @h() local_unnamed_addr #0 {
entry:
  %0 = load i32, i32* @e, align 4, !tbaa !2
  %tobool.not3 = icmp eq i32 %0, 0
  br i1 %tobool.not3, label %for.end, label %for.body.lr.ph

for.body.lr.ph:                                   ; preds = %entry
  %1 = load i32*, i32** @d, align 8
  br label %for.body

for.body:                                         ; preds = %for.body.lr.ph,
%if.then
  %2 = load i32, i32* @a, align 4, !tbaa !2
  %tobool1.not = icmp eq i32 %2, 0
  br i1 %tobool1.not, label %for.end.loopexit, label %if.then

if.then:                                          ; preds = %for.body
  store i32 %2, i32* %1, align 4, !tbaa !2
  %3 = load i32, i32* @e, align 4, !tbaa !2
  %tobool.not = icmp eq i32 %3, 0
  br i1 %tobool.not, label %for.end.loopexit, label %for.body, !llvm.loop !6

for.end.loopexit:                                 ; preds = %for.body, %if.then
  br label %for.end

for.end:                                          ; preds = %for.end.loopexit,
%entry
  ret void
}
*** IR Dump After Simplify the CFG ***
; Function Attrs: nofree noinline norecurse nounwind
define dso_local void @h() local_unnamed_addr #0 {
entry:
  %0 = load i32, i32* @e, align 4, !tbaa !2
  %tobool.not3 = icmp eq i32 %0, 0
  %1 = load i32*, i32** @d, align 8
  %.old = load i32, i32* @a, align 4
  %tobool1.not.old = icmp eq i32 %.old, 0
  %or.cond5 = or i1 %tobool.not3, %tobool1.not.old
  br i1 %or.cond5, label %for.end, label %if.then

if.then:                                          ; preds = %entry, %if.then
  store i32 %3, i32* %1, align 4, !tbaa !2
  %2 = load i32, i32* @e, align 4, !tbaa !2
  %tobool.not = icmp eq i32 %2, 0
  %3 = load i32, i32* @a, align 4
  %tobool1.not = icmp eq i32 %3, 0
  %or.cond = or i1 %tobool.not, %tobool1.not
  br i1 %or.cond, label %for.end, label %if.then, !llvm.loop !6

for.end:                                          ; preds = %if.then, %entry
  ret void
}

-- 
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/20210215/431de43c/attachment.html>


More information about the llvm-bugs mailing list