[llvm-bugs] [Bug 2563] SimplifyCFG is not collapsing unneeded switches

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Apr 7 09:15:53 PDT 2017


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

Brian Rzycki <brzycki at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |brzycki at gmail.com
         Resolution|---                         |WORKSFORME

--- Comment #4 from Brian Rzycki <brzycki at gmail.com> ---
While inspecting ComputeValueKnownInPredecessors() in JumpThreading.cpp we came
across the following comment:

    /// TODO: Per PR2563, we could infer value range information about a
    /// predecessor based on its terminator.

We went to see if this is still an issue given the age of this ticket with a
recent tip build of LLVM.

The output at -O3 looks like the following:

cond.false3.i17.i:                                ; preds = %grad.exit48.i
  %27 = or i32 %and.i12.i, 2
  %28 = icmp eq i32 %27, 14
  %cond9.i16.i = select i1 %28, double %sub.i, double 0xBFCE147AE147B000
  br label %grad.exit28.i


This is almost identical to the code transform Eli suggested in Comment 3. I
think this ticket can be closed as done.

-- 
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/20170407/0fdd0792/attachment.html>


More information about the llvm-bugs mailing list