[PATCH] D85912: [VectorCombine] Fix for non-zero addrspace when creating vector load from scalar load

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 13 08:56:52 PDT 2020


spatel accepted this revision.
spatel added a comment.
This revision is now accepted and ready to land.

Thanks! LGTM - see inline for a minor mod.



================
Comment at: llvm/lib/Transforms/Vectorize/VectorCombine.cpp:125-126
   // Original pattern: insertelt undef, load [free casts of] ScalarPtr, 0
   int OldCost = TTI.getMemoryOpCost(Instruction::Load, ScalarTy, Alignment,
                                     Load->getPointerAddressSpace());
   APInt DemandedElts = APInt::getOneBitSet(VecNumElts, 0);
----------------
Let's put the address space into a local variable above this, so we don't have to repeat the 'get'. That will make future enhancements easier too.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85912/new/

https://reviews.llvm.org/D85912



More information about the llvm-commits mailing list