[PATCH] D70315: [InstCombine][AMDGPU] Trim more components of *buffer_load
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 19 04:40:00 PST 2019
arsenm added inline comments.
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp:989
+ // Assume the arguments are unchanged and later override them, if needed.
+ SmallVector<Value *, 16> Args;
+ for (unsigned I = 0, E = II->getNumArgOperands(); I != E; ++I) {
----------------
Can you do Args(II->arg_begin(), II->arg_end())?
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp:1038-1039
+ auto Offset = II->getArgOperand(OffsetIdx);
+ unsigned OffsetAdd =
+ UnusedComponentsAtFront * II->getType()->getScalarSizeInBits() / 8;
+ auto OffsetAddVal = ConstantInt::get(Offset->getType(), OffsetAdd);
----------------
I dislike using the raw getScalarSizeInBits on the type in case these are ever used with a pointer. This should go through the datalayout. Can you also add a test that uses a pointer instead of an integer vector?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D70315/new/
https://reviews.llvm.org/D70315
More information about the llvm-commits
mailing list