@@ -20,8 +20,6 @@ SPDX-License-Identifier: MIT
20
20
#include " common/LLVMWarningsPush.hpp"
21
21
#include " llvmWrapper/IR/DerivedTypes.h"
22
22
#include " llvmWrapper/Support/Alignment.h"
23
- #include " llvm/Analysis/ValueTracking.h"
24
- #include " llvm/Support/KnownBits.h"
25
23
#include " common/LLVMWarningsPop.hpp"
26
24
#include " Probe/Assertion.h"
27
25
@@ -634,12 +632,6 @@ bool ConstantCoalescing::CompareBufferBase(
634
632
return false ;
635
633
}
636
634
637
- bool ConstantCoalescing::IsDwordAligned (Value* val) const
638
- {
639
- KnownBits knownBits = computeKnownBits (val, *dataLayout);
640
- return knownBits.countMinTrailingZeros () >= 2 ;
641
- }
642
-
643
635
void ConstantCoalescing::MergeScatterLoad (Instruction* load,
644
636
Value* bufIdxV, uint addrSpace,
645
637
Value* eltIdxV, uint offsetInBytes,
@@ -656,8 +648,7 @@ void ConstantCoalescing::MergeScatterLoad(Instruction* load,
656
648
// Current assumption is that a chunk start needs to be DWORD aligned. In
657
649
// the future we can consider adding support for merging 4 bytes or
658
650
// 2 i16s/halfs into a single non-aligned DWORD.
659
- const bool isDwordAligned = ((offsetInBytes % 4 ) == 0 &&
660
- (alignment >= 4 || eltIdxV == nullptr || IsDwordAligned (eltIdxV)));
651
+ const bool isDwordAligned = ((offsetInBytes % 4 ) == 0 && (eltIdxV == nullptr || alignment >= 4 ));
661
652
662
653
BufChunk* cov_chunk = nullptr ;
663
654
for (std::vector<BufChunk*>::reverse_iterator rit = chunk_vec.rbegin (),
@@ -1063,8 +1054,8 @@ void ConstantCoalescing::MergeUniformLoad(Instruction* load,
1063
1054
// Current assumption is that a chunk start needs to be DWORD aligned. In
1064
1055
// the future we can consider adding support for merging 4 bytes or
1065
1056
// 2 i16s/halfs into a single non-aligned DWORD.
1066
- const bool isDwordAligned = ((offsetInBytes % 4 ) == 0 &&
1067
- (alignment >= 4 || eltIdxV == nullptr || IsDwordAligned (eltIdxV) ));
1057
+ const bool isDwordAligned =
1058
+ ((offsetInBytes % 4 ) == 0 && ( eltIdxV == nullptr || alignment >= 4 ));
1068
1059
1069
1060
auto shouldMerge = [&](const BufChunk* cur_chunk)
1070
1061
{
0 commit comments