<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 - Difference in alloca naming/ordering between legacy and new pass manager"
   href="https://bugs.llvm.org/show_bug.cgi?id=50659">50659</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Difference in alloca naming/ordering between legacy and new pass manager
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </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>LLVM Codegen
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>david.spickett@linaro.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=24937" name="attach_24937" title="test file">attachment 24937</a> <a href="attachment.cgi?id=24937&action=edit" title="test file">[details]</a></span>
test file

This is following up on <a href="https://reviews.llvm.org/rGd69c4372bfbe">https://reviews.llvm.org/rGd69c4372bfbe</a>.

I had a local build that had cmake ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER=OFF and 
arm-bf16-convert-intrinsics.c failed for me once the test output was updated.

Disabling the legacy pass manager with -fno-legacy-pass-manager was suggested
and that fixed the issue.

Looking more closely, only one of the run lines in that file was failing:
// RUN: %clang_cc1 \
// RUN:   -triple armv8.6a-arm-none-eabi -target-feature +neon \
// RUN:   -target-feature +bf16 -mfloat-abi hard \
// RUN:   -disable-O0-optnone -emit-llvm -fno-legacy-pass-manager -o - %s \
// RUN:   | opt -S -mem2reg \
// RUN:   | FileCheck --check-prefixes=CHECK,CHECK-A32-HARDFP %s

By taking just that run and reducing the input down to just:
#include <arm_neon.h>

float32x4_t test_vcvtq_low_f32_bf16(bfloat16x8_t a) {
  return vcvtq_low_f32_bf16(a);
}

I saw that the order of the intial alloca, and the names assigned to them was
different. (the name change probably effects the output order somehow)

E.g.
Legacy PM: %__p0_150.i.i = alloca <4 x bfloat>, align 8
   New PM: %__p0_150.i = alloca <4 x bfloat>, align 8

With the two on different lines.

You can reproduce with the attached C file and the following command:
$ ./bin/clang -cc1 -internal-isystem ./lib/clang/13.0.0/include -nostdsysteminc
-triple armv8.6a-arm-none-eabi -target-feature +neon -target-feature +bf16
-mfloat-abi softfp -disable-O0-optnone -emit-llvm -o - -fno-legacy-pass-manager
/tmp/test_pm.c | ./bin/opt -S -mem2reg

Is this expected or indicative or something that should be the same across
both?</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>