[llvm] r319894 - [InstSimplify] Fold insertelement into undef if index is out of bounds

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 12 07:25:33 PST 2017


For reference, the extractelement with bad index should already have been
simplified.
https://reviews.llvm.org/rL319910 recently made that stronger, but raised
some concern for AMDGPU backend tests.

On Tue, Dec 12, 2017 at 8:01 AM, Igor Laevsky via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Hi Michael,
>
> In the source code I see the following operations:
>   %122 = extractelement <4 x i32> %121, i32 6
> and:
>   %124 = insertelement <4 x i32> %121, i32 %123, i32 6
>
> This operations has undefined result (see https://llvm.org/docs/
> LangRef.html#extractelement-instruction). Looks like a bug in the
> frontend. Do you know what’s the best approach here?
>
>
> On 12 Dec 2017, at 13:45, Michel Dänzer <michel at daenzer.net> wrote:
>
> On 2017-12-12 11:08 AM, Igor Laevsky wrote:
>
> I reverted problematic changes in the https://reviews.llvm.org/rL320466
>
>
> Thanks.
>
>
> Is it possible to obtain an llvm-ir of the failing test case before the
> optimizations? I can see the miscompile, but I can’t reproduce it using
> optimised good case.
>
>
> The attached should be the LLVM IR before optimizations.
>
>
> --
> Earthling Michel Dänzer               |               http://www.amd.com
> Libre software enthusiast             |             Mesa and X developer
> <fcc-read-to-pbo-after-clear.ll>
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171212/ff9d77d3/attachment.html>


More information about the llvm-commits mailing list