Extract LaneBitmask into a separate type
Specifically avoid implicit conversions from/to integral types to
avoid potential errors when changing the underlying type. For example,
a typical initialization of a "full" mask was "LaneMask = ~0u", which
would result in a value of 0x00000000FFFFFFFF if the type was extended
to uint64_t.
Differential Revision: https://reviews.llvm.org/D27454
llvm-svn: 289820
diff --git a/llvm/lib/Target/Hexagon/HexagonBlockRanges.cpp b/llvm/lib/Target/Hexagon/HexagonBlockRanges.cpp
index 938bdca..4463761 100644
--- a/llvm/lib/Target/Hexagon/HexagonBlockRanges.cpp
+++ b/llvm/lib/Target/Hexagon/HexagonBlockRanges.cpp
@@ -234,13 +234,13 @@
RegisterSet LiveIns;
RegisterSet Tmp;
for (auto I : B.liveins()) {
- if (I.LaneMask == ~LaneBitmask(0)) {
+ if (I.LaneMask.all()) {
Tmp.insert({I.PhysReg,0});
continue;
}
for (MCSubRegIndexIterator S(I.PhysReg, &TRI); S.isValid(); ++S) {
LaneBitmask M = TRI.getSubRegIndexLaneMask(S.getSubRegIndex());
- if (M & I.LaneMask)
+ if (!(M & I.LaneMask).none())
Tmp.insert({S.getSubReg(), 0});
}
}