File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
llvm/lib/Transforms/Scalar Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -1627,9 +1627,11 @@ bool EarlyCSE::processNode(DomTreeNode *Node) {
16271627 LastStore = nullptr ;
16281628
16291629 // If this is a read-only or write-only call, process it. Skip store
1630- // MemInsts, as they will be more precisely handled lateron.
1630+ // MemInsts, as they will be more precisely handled later on. Also skip
1631+ // memsets, as DSE may be able to optimize them better by removing the
1632+ // earlier rather than later store.
16311633 if (CallValue::canHandle (&Inst) &&
1632- (!MemInst.isValid () || !MemInst.isStore ())) {
1634+ (!MemInst.isValid () || !MemInst.isStore ()) && !isa<MemSetInst>(&Inst) ) {
16331635 // If we have an available version of this call, and if it is the right
16341636 // generation, replace this instruction.
16351637 std::pair<Instruction *, unsigned > InVal = AvailableCalls.lookup (&Inst);
You can’t perform that action at this time.
0 commit comments