<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 - "opt -indvars" increases file size from 3970 to 4796465152 bytes"
   href="https://bugs.llvm.org/show_bug.cgi?id=38538">38538</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>"opt -indvars" increases file size from 3970 to 4796465152 bytes
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </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>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>mikael.holmen@ericsson.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=20685" name="attach_20685" title="reproducer">attachment 20685</a> <a href="attachment.cgi?id=20685&action=edit" title="reproducer">[details]</a></span>
reproducer

Something seems to go haywire in indvars when it's applied to in.ll

Running
 opt -S -o out.ll in.ll -indvars

gives an out.ll file that is huge.

The input in.ll is 3970 bytes and the output out.ll is 4796465152.

It seems like one or a few lines in the output are totally humongous:

elxhw7c132-n7[llvm]: wc out.ll
        81 1619001735 7885294709 out.ll


The first huge line I see starts like this:

  store i32 select (i1 icmp slt (i16 ashr (i16 add (i16 mul (i16 trunc (i32
select (i1 icmp slt (i16 ashr (i16 or (i16 and (i16 shl (i16 trunc (i32 sel
ect (i1 icmp slt (i16 ashr (i16 or (i16 and (i16 shl (i16 trunc (i32 select (i1
icmp slt (i16 ashr (i16 or (i16 and (i16 shl (i16 trunc (i32 select (i1
 icmp slt (i16 ashr (i16 or (i16 and (i16 shl (i16 trunc (i32 select (i1 icmp
slt (i16 ashr (i16 or (i16 and (i16 shl (i16 trunc (i32 select (i1 icmp s
lt (i16 ashr (i16 or (i16 and (i16 shl (i16 trunc (i32 select (i1 icmp slt (i16
ashr (i16 or (i16 and (i16 shl (i16 trunc (i32 select (i1 icmp slt (i16
 ashr (i16 or (i16 and (i16 shl (i16 trunc (i32 select (i1 icmp slt (i16 ashr
(i16 or (i16 and (i16 shl (i16 trunc (i32 select (i1 icmp slt (i16 ashr (
i16 or (i16 and (i16 shl (i16 trunc (i32 select (i1 icmp slt (i16 ashr (i16 or
(i16 and (i16 shl (i16 trunc (i32 select (i1 icmp slt (i16 ashr (i16 or 
(i16 and (i16 shl (i16 trunc (i32 select (i1 icmp slt (i16 ashr (i16 or (i16
and (i16 shl (i16 trunc (i32 select (i1 icmp slt (i16 ashr (i16 or (i16 an
d (i16 shl (i16 trunc (i32 select (i1 icmp slt (i16 ashr (i16 or (i16 and (i16
shl (i16 trunc (i32 select (i1 icmp slt (i16 ashr (i16 or (i16 and (i16 
shl (i16 trunc (i32 select (i1 icmp slt (i16 ashr (i16 or (i16 and (i16 shl
(i16 trunc (i32 select (i1 icmp slt (i16 ashr (i16 or (i16 and (i16 shl (i1
6 trunc (i32 select (i1 icmp slt (i16 ashr (i16 or (i16 and (i16 shl (i16 trunc
(i32 select (i1 icmp slt (i16 ashr (i16 or (i16 and (i16 shl (i16 trunc
 (i32 select (i1 icmp slt (i16 ashr (i16 or (i16 and (i16 shl (i16 trunc (i32
select (i1 icmp slt (i16 ashr (i16 or (i16 shl (i16 trunc (i32 select (i1
 icmp ugt (i32 select (i1 icmp ne (i16** getelementptr inbounds ([5 x [4 x [1 x
i16*]]], [5 x [4 x [1 x i16*]]]* @g_864, i64 0, i64 1, i64 3, i64 0), i
16** @g_1087), i32 -52357337, i32 -52357338), i32 -23460), i32 1, i32 0) to
i16), i16 9), i16 7), i16 13), i16 0), i32 select (i1 icmp ugt (i32 select 
(i1 icmp ne (i16** getelementptr inbounds ([5 x [4 x [1 x i16*]]], [5 x [4 x [1
x i16*]]]* @g_864, i64 0, i64 1, i64 3, i64 0), i16** @g_1087), i32 -52
357337, i32 -52357338), i32 -23460), i32 1, i32 0), i32 sub (i32 select (i1
icmp ugt (i32 select (i1 icmp ne (i16** getelementptr inbounds ([5 x [4 x [
1 x i16*]]], [5 x [4 x [1 x i16*]]]* @g_864, i64 0, i64 1, i64 3, i64 0), i16**
@g_1087), i32 -52357337, i32 -52357338), i32 -23460), i32 1, i32 0), i3
2 sext (i16 ashr (i16 or (i16 shl (i16 trunc (i32 select (i1 icmp ugt (i32
select (i1 icmp ne (i16** getelementptr inbounds ([5 x [4 x [1 x i16*]]], [5
 x [4 x [1 x i16*]]]* @g_864, i64 0, i64 1, i64 3, i64 0), i16** @g_1087), i32
-52357337, i32 -52357338), i32 -23460), i32 1, i32 0) to i16), i16 9), i
16 7), i16 13) to i32))) to i16), i16 9), i16 512), i16 7), i16 13), i16 0),
i32 select (i1 icmp ugt (i32 select (i1 icmp ne (i16** getelementptr inbou
nds ([5 x [4 x [1 x i16*]]], [5 x [4 x [1 x i16*]]]* @g_864, i64 0, i64 1, i64
3, i64 0), i16** @g_1087), i32 -52357337, i32 -52357338), i32 -23460), i
32 1, i32 0), i32 sub (i32 select (i1 icmp ugt (i32 select (i1 icmp ne (i16**
getelementptr inbounds ([5 x [4 x [1 x i16*]]], [5 x [4 x [1 x i16*]]]* @
g_864, i64 0, i64 1, i64 3, i64 0), i16** @g_1087), i32 -52357337, i32
-52357338), i32 -23460), i32 1, i32 0), i32 sext (i16 ashr (i16 or (i16 and
(i16
 shl (i16 trunc (i32 select (i1 icmp slt (i16 ashr (i16 or (i16 shl (i16 trunc
(i32 select (i1 icmp ugt (i32 select (i1 icmp ne (i16** getelementptr in
bounds ([5 x [4 x [1 x i16*]]], [5 x [4 x [1 x i16*]]]* @g_864, i64 0, i64 1,
i64 3, i64 0), i16** @g_1087), i32 -52357337, i32 -52357338), i32 -23460)
, i32 1, i32 0) to i16), i16 9), i16 7), i16 13), i16 0), i32 select (i1 icmp
ugt (i32 select (i1 icmp ne (i16** getelementptr inbounds ([5 x [4 x [1 x
 i16*]]], [5 x [4 x [1 x i16*]]]* @g_864, i64 0, i64 1, i64 3, i64 0), i16**
@g_1087), i32 -52357337, i32 -52357338), i32 -23460), i32 1, i32 0), i32 s
ub (i32 select (i1 icmp ugt (i32 select (i1 icmp ne (i16** getelementptr
inbounds ([5 x [4 x [1 x i16*]]], [5 x [4 x [1 x i16*]]]* @g_864, i64 0, i64 1
, i64 3, i64 0), i16** @g_1087), i32 -52357337, i32 -52357338), i32 -23460),
i32 1, i32 0), i32 sext (i16 ashr (i16 or (i16 shl (i16 trunc (i32 select 
(i1 icmp ugt (i32 select (i1 icmp ne (i16** getelementptr inbounds ([5 x [4 x
[1 x i16*]]], [5 x [4 x [1 x i16*]]]* @g_864, i64 0, i64 1, i64 3, i64 0)
, i16** @g_1087), i32 -52357337, i32 -52357338), i32 -23460), i32 1, i32 0) to
i16), i16 9), i16 7), i16 13) to i32))) to i16), i16 9), i16 512), i16 7
), i16 13) to i32))) to i16), i16 9), i16 512), i16 7), i16 13), i16 0), i32
select (i1 icmp ugt (i32 select (i1 icmp ne (i16** getelementptr inbounds 
([5 x [4 x [1 x i16*]]], [5 x [4 x [1 x i16*]]]* @g_864, i64 0, i64 1, i64 3,
i64 0), i16** @g_1087), i32 -52357337, i32 -52357338), i32 -23460), i32 1
, i32 0), i32 sub (i32 select (i1 icmp ugt (i32 select (i1 icmp ne (i16**
getelementptr inbounds ([5 x [4 x [1 x i16*]]], [5 x [4 x [1 x i16*]]]* @g_86
4, i64 0, i64 1, i64 3, i64 0), i16** @g_1087), i32 -52357337, i32 -52357338),
i32 -23460), i32 1, i32 0), i32 sext (i16 ashr (i16 or (i16 and (i16 shl
 (i16 trunc (i32 select (i1 icmp slt (i16 ashr (i16 or (i16 and (i16 shl (i16
trunc (i32 select (i1 icmp slt (i16 ashr (i16 or (i16 shl (i16 trunc (i32
 select (i1 icmp ugt (i32 select (i1 icmp ne (i16** getelementptr inbounds ([5
x [4 x [1 x i16*]]], [5 x [4 x [1 x i16*]]]* @g_864, i64 0, i64 1, i64 3
, i64 0), i16** @g_1087), i32 -52357337, i32 -52357338), i32 -23460), i32 1,
i32 0) to i16), i16 9), i16 7), i16 13), i16 0), i32 select (i1 icmp ugt (
i32 select (i1 icmp ne (i16** getelementptr inbounds ([5 x [4 x [1 x i16*]]],
[5 x [4 x [1 x i16*]]]* @g_864, i64 0, i64 1, i64 3, i64 0), i16** @g_108
7), i32 -52357337, i32 -52357338), i32 -23460), i32 1, i32 0), i32 sub (i32
select (i1 icmp ugt (i32 select (i1 icmp ne (i16** getelementptr inbounds (
[5 x [4 x [1 x i16*]]], [5 x [4 x [1 x i16*]]]* @g_864, i64 0, i64 1, i64 3,
i64 0), i16** @g_1087), i32 -52357337, i32 -52357338), i32 -23460), i32 1,
 i32 0), i32 sext (i16 ashr (i16 or (i16 shl (i16 trunc (i32 select (i1 icmp
ugt (i32 select (i1 icmp ne (i16** getelementptr inbounds ([5 x [4 x [1 x 
i16*]]], [5 x [4 x [1 x i16*]]]* @g_864, i64 0, i64 1, i64 3, i64 0), i16**
@g_1087), i32 -52357337, i32 -52357338), i32 -23460), i32 1, i32 0) to i16)
, i16 9), i16 7), i16 13) to i32))) to i16), i16 9), i16 512), i16 7), i16 13),
i16 0), i32 select (i1 icmp ugt (i32 select (i1 icmp ne (i16** geteleme
ntptr inbounds ([5 x [4 x [1 x i16*]]], [5 x [4 x [1 x i16*]]]* @g_864, i64 0,
i64 1, i64 3, i64 0), i16** @g_1087), i32 -52357337, i32 -52357338), i32</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>