projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e39d788
)
[InstCombine] recognizeBSwapOrBitReverseIdiom - assert for correct bit providence...
author
Simon Pilgrim
<llvm-dev@redking.me.uk>
Wed, 30 Sep 2020 10:13:54 +0000
(11:13 +0100)
committer
Simon Pilgrim
<llvm-dev@redking.me.uk>
Wed, 30 Sep 2020 10:16:33 +0000
(11:16 +0100)
As suggested by @spatel on D88316
llvm/lib/Transforms/Utils/Local.cpp
patch
|
blob
|
history
diff --git
a/llvm/lib/Transforms/Utils/Local.cpp
b/llvm/lib/Transforms/Utils/Local.cpp
index
61f4dff
..
8ff11ba
100644
(file)
--- a/
llvm/lib/Transforms/Utils/Local.cpp
+++ b/
llvm/lib/Transforms/Utils/Local.cpp
@@
-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.