Skip to content

Commit 6b5a1d4

Browse files
committed
Remove change that is already implemented in 9d424e0
Signed-off-by: Gregory Shimansky <[email protected]>
1 parent 835497a commit 6b5a1d4

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

lib/Tools/LinearLayout.cpp

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,6 @@ void dumpMatrix(uint64_t *m, int numRows, int numCols) {
6262
}
6363
}
6464

65-
static inline uint32_t countTrailingZeros(uint32_t x) {
66-
#ifdef _MSC_VER
67-
unsigned long index;
68-
_BitScanForward(&index, x);
69-
return index;
70-
#else
71-
return __builtin_ctz(x);
72-
#endif
73-
}
74-
7565
// Build a matrix of size sum(outDimSizeLog2) x sum(inDimSizeLog2) representing
7666
// the bases of the given layout. This can then be used by f2reduce.
7767
//
@@ -488,7 +478,7 @@ int32_t LinearLayout::getNumConsecutiveInOut() const {
488478
}
489479
}
490480
}
491-
int32_t trailingZeros = otherBits != 0 ? countTrailingZeros(otherBits) : 31;
481+
int32_t trailingZeros = otherBits != 0 ? __builtin_ctz(otherBits) : 31;
492482

493483
return 1 << std::min(consec, trailingZeros);
494484
}
@@ -1064,7 +1054,7 @@ LinearLayout::getFreeVariableMasks() const {
10641054
if (mat[r] == 0) {
10651055
continue;
10661056
}
1067-
basicVars.insert(countTrailingZeros(mat[r]));
1057+
basicVars.insert(__builtin_ctzll(mat[r]));
10681058
}
10691059

10701060
llvm::MapVector<StringAttr, int32_t> ret;

0 commit comments

Comments
 (0)