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

    <tr>
        <th>Summary</th>
        <td>
            Attributor & Function-attrs mark function as noundef incorrectly due to return value not in range
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            miscompilation,
            llvm::Attributor
      </td>
    </tr>

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

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

<pre>
    This example returns a constant value out of range:
```llvm
define range(i32 0, 42) i32 @range_attribute(<4 x i32> range(i32 -1, 42) %a) {
  ret i32 43
}
```

Running `opt -S -p='attributor'` gives an incorrect result:
```llvm
define noundef range(i32 0, 42) i32 @fn() {
  ret i32 43
}
```

`opt -S -p='function-attrs'` has the same bug.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykU82OnDAMfhpzsWYUHH6GA4fZnc4DtL1XAQykDQnKz2r37SuY2d1ue2ilSojI2Mbfj6NC0JNlbqF8gPKSqRRn51ubrFuNWzlknRte2q-zDsjPalkNo-eYvA2osHc2RGUjPimTGF2K6Eb0yk4M8gziAuIMlbg9xjwtt08Dj9ryvY5OWhIKoEcsCKjBLYRC7NlvKkavuxS3OpCPBT5veZCfPnQf8vd2oFLtZ_1wm4Yb4P2vhbxDqi-_YbuH-_tzslbbCaESbo14-IKHFeQFqH4F4zxQDZXAST9xQGVR2955z31EzyGZ-A_srUt24PEvKox2I_4_dP6kMSbbR-3sYeMT7lRmFTDOjEEtjF2ajtnQyqGRjcq4zeucyqYRpzyb227kXlZjo6ipmibnui7VMMp6GGpVybzKdEuCClGIU16Xddkca1lSX46jOqmu6AqCQvCitDluohydnzIdQuL2dBJUZUZ1bMK-kESLDr1bVm3UhhiIgB6BaFdTnkGez794QtsG-3ZLHro0BSiE0SGG9zlRR8Ptew8CVXj9oAcuyv_AV41QhTen3kw2LzgkxujuV-G-_tZF1PZmaJa8aecY17DBpCvQddJxTt2xdwvQdSdwOw6rd9-5j0DXXYYAdN2V-BkAAP__HIAWCg">