[llvm-bugs] [Bug 37942] New: [debugify] fails from Combine redundant instructions and SROA

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jun 26 06:21:20 PDT 2018


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

            Bug ID: 37942
           Summary: [debugify] fails from Combine redundant instructions
                    and SROA
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: greg.bedwell at sony.com
                CC: anastasis.gramm2 at gmail.com, llvm-bugs at lists.llvm.org,
                    paul_robinson at playstation.sony.com,
                    sontuan.vu119 at gmail.com, vsk at apple.com

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

We've been looking at cases where debugify currently fails.  Here is an example
(courtesy of Stephen Wilks) of a test-case that was reduced at source-level
using the condition of "[SROA]: FAIL" being present in the debugify output. 
The reduced output is obviously somewhat silly with the assignment to qaz on
the last line being completely redundant. I sadly don't have time to look more
deeply at the moment, but before going further and reporting more failures I'd
like to verify whether the presence of debugify fails should always be
considered a bug, or whether in some cases a debugify fail could be expected in
the presence of things like completely redundant operations or do we need to
enforce some sanity checking on the testcases before and during reduction
first?  

$ clang --version
clang version 7.0.0 (trunk 335577) (llvm/trunk 335591)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: e:\work\upstream-llvm\build-vs2015-native-ninja\bin

$ cat 1.cpp
int foo(int);
void bar() {
  int baz[6] = {};
  foo(baz[2]);
  long qaz = (long)baz;
}

$ clang -O0 -Xclang -disable-O0-optnone -S -emit-llvm 1.cpp -o 1.ll

$ opt 1.ll -instcombine -sroa -disable-output -debugify-each
WARNING: Missing line 2
WARNING: Missing line 8
WARNING: Missing line 9
WARNING: Missing line 10
ERROR: Missing variable 2
ERROR: Missing variable 8
CheckFunctionDebugify [Combine redundant instructions]: FAIL
ERROR: Instruction with empty DebugLoc in function ?bar@@YAXXZ --  %baz.sroa.2
= alloca [3 x i32]
WARNING: Missing line 1
WARNING: Missing line 2
WARNING: Missing line 4
WARNING: Missing line 5
CheckFunctionDebugify [SROA]: FAIL
CheckFunctionDebugify [Module Verifier]: PASS

-- 
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/20180626/5be7e012/attachment.html>


More information about the llvm-bugs mailing list