[llvm] [AggressiveInstCombine] Merge consecutive loads of mixed sizes (PR #129263)
Yingwei Zheng via llvm-commits
llvm-commits at lists.llvm.org
Sat Mar 1 01:00:22 PST 2025
================
@@ -675,10 +675,10 @@ static bool foldLoadsRecursive(Value *V, LoadOps &LOps, const DataLayout &DL,
Load2Ptr->stripAndAccumulateConstantOffsets(DL, Offset2,
/* AllowNonInbounds */ true);
- // Verify if both loads have same base pointers and load sizes are same.
+ // Verify if both loads have same base pointers
uint64_t LoadSize1 = LI1->getType()->getPrimitiveSizeInBits();
uint64_t LoadSize2 = LI2->getType()->getPrimitiveSizeInBits();
- if (Load1Ptr != Load2Ptr || LoadSize1 != LoadSize2)
+ if (Load1Ptr != Load2Ptr)
return false;
// Support Loadsizes greater or equal to 8bits and only power of 2.
----------------
dtcxzyw wrote:
Missing check for `LoadSize2 < 8 || !isPowerOf2_64(LoadSize2)`.
Please add some negative tests.
https://github.com/llvm/llvm-project/pull/129263
More information about the llvm-commits
mailing list