Skip to content

Commit 43551f4

Browse files
pkwasnie-inteligcbot
authored andcommitted
Use llvm::SparseBitVector on Linux
On Linux, llvm::SparseBitVector provides comparable compilation time to FastSparseBitVector with smaller memory footprint.
1 parent cc39998 commit 43551f4

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

visa/FastSparseBitVector.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ SPDX-License-Identifier: MIT
1111
#ifndef _FASTSPARSEVECTOR_H_
1212
#define _FASTSPARSEVECTOR_H_
1313

14+
#if defined(_WIN64) || defined(_WIN32)
15+
1416
// Following implementation of sparse bitvector is inspired from llvm's
1517
// SparseBitVector. There are some changes made to make it faster.
1618
// llvm's version stores SparseBitVectorElement instances as a linked
@@ -675,4 +677,16 @@ operator-(const FastSparseBitVector<ElementSize> &LHS,
675677

676678
typedef FastSparseBitVector<2048> SparseBitVector;
677679

680+
#else
681+
682+
// On Linux, llvm's SparseBitVector offers comparable compilation time
683+
// with smaller memory footprint. In future, we may consider switching
684+
// to FastSparseBitVector for Linux as well.
685+
686+
#include "llvm/ADT/SparseBitVector.h"
687+
688+
typedef llvm::SparseBitVector<2048> SparseBitVector;
689+
690+
#endif
691+
678692
#endif

0 commit comments

Comments
 (0)