[GlobalISel][KnownBits] Early return on out of bound shift amounts
authorKonstantin Schwarz <konstantin.schwarz@hightec-rt.com>
Mon, 12 Oct 2020 09:45:33 +0000 (11:45 +0200)
committerKonstantin Schwarz <konstantin.schwarz@hightec-rt.com>
Mon, 12 Oct 2020 16:39:19 +0000 (18:39 +0200)
commit734112343917a011676c2915c5e5d29803a51ba6
tree29f0e85ed234a2ae1ddeda9a24b4bd397a0e797b
parent2f66bfac280f9ae9299dccc357ae10e8a48525ed
[GlobalISel][KnownBits] Early return on out of bound shift amounts

If the known shift amount is bigger than or equal to the bitwidth of the type of the value to be shifted,
the result is target dependent, so don't try to infer any bits.

This fixes a crash we've seen in one of our internal test suites.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D89232
llvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp
llvm/unittests/CodeGen/GlobalISel/KnownBitsTest.cpp