[llvm-bugs] [Bug 31753] New: llvm/lib/CodeGen/MachinePipeliner.cpp: 2 * pointless tests

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jan 25 02:11:08 PST 2017


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

            Bug ID: 31753
           Summary: llvm/lib/CodeGen/MachinePipeliner.cpp: 2 * pointless
                    tests
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: dcb314 at hotmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

1.

lvm/lib/CodeGen/MachinePipeliner.cpp:963]: (style) Condition
'Phi.getOperand(i+1).getMBB()==Loop' is always true

Source code is

  for (unsigned i = 1, e = Phi.getNumOperands(); i != e; i += 2)
    if (Phi.getOperand(i + 1).getMBB() != Loop)
      InitVal = Phi.getOperand(i).getReg();
    else if (Phi.getOperand(i + 1).getMBB() == Loop)
      LoopVal = Phi.getOperand(i).getReg();

Suggest new code

  for (unsigned i = 1, e = Phi.getNumOperands(); i != e; i += 2)
    if (Phi.getOperand(i + 1).getMBB() != Loop)
      InitVal = Phi.getOperand(i).getReg();
    else 
      LoopVal = Phi.getOperand(i).getReg();

-- 
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/20170125/bd9c51f6/attachment-0001.html>


More information about the llvm-bugs mailing list