<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 - [SimplifyCFG] Chain of comparisons no longer flattened"
   href="https://bugs.llvm.org/show_bug.cgi?id=51211">51211</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[SimplifyCFG] Chain of comparisons no longer flattened
          </td>
        </tr>

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

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

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </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>Scalar Optimizations
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>nikita.ppv@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>lebedev.ri@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>For the following Rust code:

pub struct Blueprint {
    pub fuel_tank_size: u32,
    pub payload: u32,
    pub wheel_diameter: u32,
    pub wheel_width: u32,
}
impl PartialEq for Blueprint{
    fn eq(&self, other: &Self) -> bool {
       self.fuel_tank_size == other.fuel_tank_size
            && self.payload == other.payload
            && self.wheel_diameter == other.wheel_diameter
            && self.wheel_width == other.wheel_width
    }
}

LLVM 12 managed to compile this to a nice <4 x i32> comparison, while in LLVM
13 this is a sequence of i32 comparisons with two branches sitting in between.

Here is an end-to-end IR test case: <a href="https://llvm.godbolt.org/z/59cT1coT6">https://llvm.godbolt.org/z/59cT1coT6</a>

The relevant difference is that SimplifyCFG no longer fully flattens the
control flow in this case.

Here is just the -simplifycfg part: <a href="https://llvm.godbolt.org/z/zfd9Ybx58">https://llvm.godbolt.org/z/zfd9Ybx58</a>

I haven't checked what change caused this yet.</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>