[ADT] Remove 0-width Asserts in APInt.getZExtValue
authorSchuyler Eldridge <schuyler.eldridge@sifive.com>
Tue, 30 Nov 2021 05:47:08 +0000 (00:47 -0500)
committerSchuyler Eldridge <schuyler.eldridge@sifive.com>
Tue, 30 Nov 2021 22:03:12 +0000 (17:03 -0500)
commit63f417ef39963afa9722a7b3c5cf3b28a9d41883
tree1449b06641d65a75af52e887c98ee08adba00d41
parentaeeacbd989fc474d920afa1b1dd3fb4ef502c726
[ADT] Remove 0-width Asserts in APInt.getZExtValue

Remove assertion that disallows getting a zero-extended value from a
zero-width APInt.  This check is too restrictive and makes it difficult
to use APInt to model zero-width things, e.g., zero-width wires in the
CIRCT project.

Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
Reviewed By: lattner, darthscsi, nikic

Differential Revision: https://reviews.llvm.org/D114768
llvm/include/llvm/ADT/APInt.h
llvm/unittests/ADT/APIntTest.cpp