Skip to content

Commit 6fe0f68

Browse files
committed
address comments
1 parent ead579d commit 6fe0f68

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

llvm/include/llvm/CodeGen/GlobalISel/GIMatchTableExecutor.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -722,8 +722,9 @@ class GIMatchTableExecutor {
722722
// - Fast common case handling (1 byte values).
723723
LLVM_ATTRIBUTE_ALWAYS_INLINE static uint64_t
724724
fastDecodeULEB128(const uint8_t *MatchTable, uint64_t &CurrentIdx) {
725-
uint64_t Value = MatchTable[CurrentIdx] & 0x7f;
726-
if (LLVM_UNLIKELY(MatchTable[CurrentIdx++] >= 128)) {
725+
uint64_t Value = MatchTable[CurrentIdx++];
726+
if (LLVM_UNLIKELY(Value >= 128)) {
727+
Value &= 0x7f;
727728
unsigned Shift = 7;
728729
do {
729730
uint64_t Slice = MatchTable[CurrentIdx] & 0x7f;

llvm/utils/TableGen/Common/GlobalISel/GlobalISelMatchTable.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1565,7 +1565,7 @@ bool MemoryAddressSpacePredicateMatcher::isIdentical(
15651565

15661566
void MemoryAddressSpacePredicateMatcher::emitPredicateOpcodes(
15671567
MatchTable &Table, RuleMatcher &Rule) const {
1568-
assert(AddrSpaces.size() < 255);
1568+
assert(AddrSpaces.size() < 256);
15691569
Table << MatchTable::Opcode("GIM_CheckMemoryAddressSpace")
15701570
<< MatchTable::Comment("MI") << MatchTable::ULEB128Value(InsnVarID)
15711571
<< MatchTable::Comment("MMO")

0 commit comments

Comments
 (0)