[LLVMbugs] [Bug 3277] New: llvm-g++ front-end outputing code that is not folded by irbuilder?

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Fri Jan 2 00:41:21 PST 2009


http://llvm.org/bugs/show_bug.cgi?id=3277

           Summary: llvm-g++ front-end outputing code that is not folded by
                    irbuilder?
           Product: tools
           Version: 1.0
          Platform: PC
        OS/Version: All
            Status: NEW
          Keywords: slow-compile
          Severity: normal
          Priority: P2
         Component: llvm-g++
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: clattner at apple.com
                CC: llvmbugs at cs.uiuc.edu


On this testcase (Reduced from kc++):
class impl_abstract_phylum {
public:
    virtual int subphylum(int) const;
    virtual ~impl_abstract_phylum() { }
};
int impl_abstract_phylum::subphylum(int no) const {
  return 0;
}

llvm-g++ -O0 is producing:

define linkonce void
@_ZN20impl_abstract_phylumD1Ev(%struct.impl_abstract_phylum* %this) nounwind {
entry:
...
        br label %bb

bb:             ; preds = %entry
        %2 = trunc i32 0 to i8          ; <i8> [#uses=1]
        %toBool = icmp ne i8 %2, 0              ; <i1> [#uses=1]
        br i1 %toBool, label %bb1, label %bb2

bb1:            ; preds = %bb
        %3 = load %struct.impl_abstract_phylum** %this_addr, align 4    
        %4 = bitcast %struct.impl_abstract_phylum* %3 to i8*            ; <i8*>
[#uses=1]
        call void @_ZdlPv(i8* %4) nounwind
        br label %bb2


This is curious for two reasons: 1) we're emitting obviously dead code, which
slows down compilation at -O0.  2) IRbuilder should be folding the %2 truncate
instruction!


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list