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) {
1627
1627
LastStore = nullptr ;
1628
1628
1629
1629
// 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.
1631
1633
if (CallValue::canHandle (&Inst) &&
1632
- (!MemInst.isValid () || !MemInst.isStore ())) {
1634
+ (!MemInst.isValid () || !MemInst.isStore ()) && !isa<MemSetInst>(&Inst) ) {
1633
1635
// If we have an available version of this call, and if it is the right
1634
1636
// generation, replace this instruction.
1635
1637
std::pair<Instruction *, unsigned > InVal = AvailableCalls.lookup (&Inst);
You can’t perform that action at this time.
0 commit comments