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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected],
                    [email protected], [email protected]

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.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to