[mips][msa] Fix infinite loop for mips.nori.b intrinsic
authorSimon Atanasyan <simon@atanasyan.com>
Wed, 11 Sep 2019 11:16:06 +0000 (11:16 +0000)
committerSimon Atanasyan <simon@atanasyan.com>
Wed, 11 Sep 2019 11:16:06 +0000 (11:16 +0000)
commitd811d9115b0b2d004a568e8ebdb37ba0ea6397d1
tree4ad0f8f9c7e1e6834ca171e2c2464bd37adac2dc
parente0d9a0bd59d8ece9662c4ad618398ddcfec8d93f
[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

llvm-svn: 371607
llvm/lib/Target/Mips/MipsSEISelLowering.cpp
llvm/test/CodeGen/Mips/cconv/vector.ll
llvm/test/CodeGen/Mips/msa/2r_vector_scalar.ll
llvm/test/CodeGen/Mips/msa/nori.b.ll [new file with mode: 0644]