[PATCH] D150900: [InstCombine] Insert a bitcast to enable merging similar store insts
Jay Foad via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon May 22 00:25:44 PDT 2023
foad added inline comments.
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp:1655-1659
if ((OtherStore = dyn_cast<StoreInst>(BBI))) {
- if (OtherStore->getOperand(1) != SI.getOperand(1) ||
- !SI.isSameOperationAs(OtherStore))
+ if (!OtherStoreIsMergeable(OtherStore))
return false;
break;
}
----------------
This can be simplified as suggested, since if we find a non-mergable store, the `mayWriteToMemory` test just below will do the `return false`.
Also I think moving the cast-to-StoreInst inside the helper function would make the patch simpler overall, i.e. something like:
```
auto IsMergeableStore = [&](Instruction *OtherStore) -> bool ...
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D150900/new/
https://reviews.llvm.org/D150900
More information about the llvm-commits
mailing list