[mips][msa] Fix infinite loop for mips.nori.b intrinsic
commit68378dff20ed3412d3c35611051756bd49aed044
authorSimon Atanasyan <simon@atanasyan.com>
Wed, 11 Sep 2019 11:16:06 +0000 (11 11:16 +0000)
committerSimon Atanasyan <simon@atanasyan.com>
Wed, 11 Sep 2019 11:16:06 +0000 (11 11:16 +0000)
treedda89648da4a937334429d955c6dbd3e8f353e06
parent8ea51586a933f3a4f74228d9a6d275c5fef02edd
[mips][msa] Fix infinite loop for mips.nori.b intrinsic

When value of immediate in `mips.nori.b` is 255 (which has all ones in
binary form as 8bit integer) DAGCombiner and Legalizer would fall in an
infinite loop. DAGCombiner would try to simplify `or %value, -1` by
turning `%value` into UNDEF. Legalizer will turn it back into `Constant<0>`
which would then be again turned into UNDEF by DAGCombiner. To avoid this
loop we make UNDEF legal for MSA int types on Mips.

Patch by Mirko Brkusanin.

Differential Revision: https://reviews.llvm.org/D67280

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371607 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/Mips/MipsSEISelLowering.cpp
test/CodeGen/Mips/cconv/vector.ll
test/CodeGen/Mips/msa/2r_vector_scalar.ll
test/CodeGen/Mips/msa/nori.b.ll [new file with mode: 0644]