Reland [GlobalISel] Start using vectors in GISelKnownBits
authorPetar Avramovic <Petar.Avramovic@amd.com>
Thu, 4 Mar 2021 13:27:39 +0000 (14:27 +0100)
committerPetar Avramovic <Petar.Avramovic@amd.com>
Thu, 4 Mar 2021 20:47:13 +0000 (21:47 +0100)
commitd7834556b7ad3bbfc03ed5dd8d875d1d73c674c2
treea07a03fdf92fc2c607de89f19171a39a499a5242
parent6b8cf7356c5a01ee487a610168c146994ff6cff8
Reland [GlobalISel] Start using vectors in GISelKnownBits

This is recommit of 4c8fb7ddd6fa49258e0e9427e7345fb56ba522d4.
MIR in one unit test had mismatched types.

For vectors we consider a bit as known if it is the same for all demanded
vector elements (all elements by default). KnownBits BitWidth for vector
type is size of vector element. Add support for G_BUILD_VECTOR.
This allows combines of urem_pow2_to_mask in pre-legalizer combiner.

Differential Revision: https://reviews.llvm.org/D96122
llvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp
llvm/test/CodeGen/AMDGPU/GlobalISel/combine-urem-pow-2.mir
llvm/test/CodeGen/AMDGPU/GlobalISel/urem.i32.ll
llvm/test/CodeGen/AMDGPU/GlobalISel/urem.i64.ll
llvm/unittests/CodeGen/GlobalISel/CMakeLists.txt
llvm/unittests/CodeGen/GlobalISel/KnownBitsTest.cpp
llvm/unittests/CodeGen/GlobalISel/KnownBitsVectorTest.cpp [new file with mode: 0644]