<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [SCEV] Missing Or expression handling"
   href="https://bugs.llvm.org/show_bug.cgi?id=46056">46056</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[SCEV] Missing Or expression handling
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Loop Optimizer
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>elena.demikhovsky@intel.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The SCEV builder does not handle all cases of Or expression. Diring the
"instcombine" phase an Add instruction may be replaced with Or if there is no
common bits between two addends. When we try to create a SCEV expression, the
Or is not parsed as Add and we have SCEVUnknown on Or expression.

I suppose that we need to add something like this:

ScalarEvolution.cpp
in function
const SCEV *ScalarEvolution::createSCEV(Value *V)

..
case Instruction::Or:
..
else if (llvm::haveNoCommonBitsSet(BO->RHS, BO->LHS, getDataLayout()))
        return getAddExpr(getSCEV(BO->LHS), getSCEV(BO->RHS));</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>