[clang] [llvm] [VectorCombine] Trim low end of loads used in shufflevector rebroadcasts. (PR #149093)
Leon Clark via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 30 05:05:15 PST 2026
================
@@ -4789,8 +4793,14 @@ bool VectorCombine::shrinkLoadForShuffles(Instruction &I) {
return false;
// Create new load of smaller vector.
+ Type *IndexTy = DL->getIndexType(PtrOp->getType());
+ Constant *PtrOffset = ConstantInt::get(IndexTy, LowOffset);
+ Value *NewPtr = LowOffset > 0u
+ ? Builder.CreateInBoundsPtrAdd(PtrOp, PtrOffset)
+ : PtrOp;
----------------
PeddleSpam wrote:
Thanks both 😊
https://github.com/llvm/llvm-project/pull/149093
More information about the llvm-commits
mailing list