forked from OSchip/llvm-project
[InstCombine] recognizeBSwapOrBitReverseIdiom - assert for correct bit providence indices. NFCI.
As suggested by @spatel on D88316
This commit is contained in:
parent
e39d7884a1
commit
ec3f24d453
|
@ -3027,6 +3027,9 @@ bool llvm::recognizeBSwapOrBitReverseIdiom(
|
|||
if (!Res)
|
||||
return false;
|
||||
auto &BitProvenance = Res->Provenance;
|
||||
assert(all_of(BitProvenance,
|
||||
[](int8_t I) { return I == BitPart::Unset || 0 <= I; }) &&
|
||||
"Illegal bit provenance index");
|
||||
|
||||
// Now, is the bit permutation correct for a bswap or a bitreverse? We can
|
||||
// only byteswap values with an even number of bytes.
|
||||
|
|
Loading…
Reference in New Issue