<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/123668>123668</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [Flang][PPC] frontend `-funroll-loops` does not affect unroll on PPC target
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            flang
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          mustartt
      </td>
    </tr>
</table>

<pre>
    2 test cases that are currently failing on `ppc64-flang-aix` and `ppc64le-flang-rhel-clang`

```
FAIL: Flang::unroll-loops.fir
FAIL: Flang::unroll-loops.f90
```

```
******************** TEST 'Flang :: Integration/unroll-loops.f90' FAILED ********************
Exit Code: 1
Command Output (stderr):
--
RUN: at line 1: /home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/build/bin/flang -fc1 -emit-llvm -O1 -funroll-loops -mllvm -force-vector-width=2 -o- /home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/llvm-project/flang/test/Integration/unroll-loops.f90 | /home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/build/bin/FileCheck /home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/llvm-project/flang/test/Integration/unroll-loops.f90 --check-prefixes=CHECK,UNROLL
+ /home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/build/bin/FileCheck /home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/llvm-project/flang/test/Integration/unroll-loops.f90 --check-prefixes=CHECK,UNROLL
+ /home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/build/bin/flang -fc1 -emit-llvm -O1 -funroll-loops -mllvm -force-vector-width=2 -o- /home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/llvm-project/flang/test/Integration/unroll-loops.f90
/home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/llvm-project/flang/test/Integration/unroll-loops.f90:22:17: error: UNROLL-NEXT: is not on the line after the previous match
 ! UNROLL-NEXT: %[[GEP0:.*]] = getelementptr i64, ptr %[[ARG0]], i64 %[[IND]]
 ^
<stdin>:21:2: note: 'next' match was here
 %1 = getelementptr i64, ptr %0, i64 %index
 ^
<stdin>:14:51: note: previous match ended here
 %step.add = add <2 x i64> %vec.ind, splat (i64 2)
 ^
<stdin>:15:1: note: non-matching line after previous match is here
 %step.add.2 = add <2 x i64> %vec.ind, splat (i64 4)
^
Input file: <stdin>
Check file: /home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/llvm-project/flang/test/Integration/unroll-loops.f90
-dump-input=help explains the following input dump.
Input was:
<<<<<<
         .
 .
         .
        16:  %step.add.3 = add <2 x i64> %vec.ind, splat (i64 6) 
        17:  %step.add.4 = add <2 x i64> %vec.ind, splat (i64 8) 
 18:  %step.add.5 = add <2 x i64> %vec.ind, splat (i64 10) 
        19: %step.add.6 = add <2 x i64> %vec.ind, splat (i64 12) 
        20: %step.add.7 = add <2 x i64> %vec.ind, splat (i64 14) 
        21:  %1 = getelementptr i64, ptr %0, i64 %index 
next:22 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  error: match on wrong line
 22:  %2 = getelementptr i8, ptr %1, i64 16 
        23:  %3 = getelementptr i8, ptr %1, i64 32 
        24:  %4 = getelementptr i8, ptr %1, i64 48 
        25:  %5 = getelementptr i8, ptr %1, i64 64 
        26: %6 = getelementptr i8, ptr %1, i64 80 
         .
         .
 .
>>>>>>
--
********************
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.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