[llvm-bugs] [Bug 33497] New: GuardWidening creates extra instructions during analysis and does not clean up

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Jun 17 20:34:45 PDT 2017


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

            Bug ID: 33497
           Summary: GuardWidening creates extra instructions during
                    analysis and does not clean up
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: listmail at philipreames.com
                CC: llvm-bugs at lists.llvm.org

I noticed when analysing an inlining problem that the guard widening pass is
creating additional instructions and not removing them.  The net effect is that
guard widening adds instructions when run even if the transform doesn't
trigger.  If it does trigger, then we leave duplicate copies of the comparisons
in place.

The guilty function is widenCondCommon which is used both for analysis and
transform.

The extra IR generated is trivially dead and removable so most any other pass
will remove it, but we really shouldn't be relying on other passes for basic
cleanliness.  

You can see this behaviour by simply inspecting the output of the already in
tree test/Transforms/GuardWidening/range-check-merging.ll.  (Not the check
statements; the actual output.)

-- 
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/20170618/ba0fff4d/attachment.html>


More information about the llvm-bugs mailing list