[PATCH] D84471: [X86] Fix for ballooning compile times due to Load Value Injection (LVI) mitigations

Matthew Riley via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 24 16:07:39 PDT 2020


mattdr accepted this revision.
mattdr added inline comments.
This revision is now accepted and ready to land.


================
Comment at: llvm/lib/Target/X86/X86LoadValueInjectionLoadHardening.cpp:702-703
+      for (const auto *EgressEdge : EgressEdges)
+        EgressCutCost +=
+            CutEdges.contains(*EgressEdge) ? 0 : EgressEdge->getValue();
+      for (const auto *IngressEdge : IngressEdges)
----------------
I think this is clearer as:

```
  if (!CutEdges.contains(*EgressEdge))
    EgressCutCost += EgressEdge->getValue();
```

likewise for the loop over `IngressEdges`.


================
Comment at: llvm/lib/Target/X86/X86LoadValueInjectionLoadHardening.cpp:706
+          IngressCutCost < EgressCutCost ? IngressEdges : EgressEdges;
+      llvm::for_each(EdgesToCut, [&](EdgeRef E) { CutEdges.insert(*E); });
     }
----------------
sconstab wrote:
> mattdr wrote:
> > EdgeSet has `|=` for union, maybe that would be better here
> `|=` is not overloaded for an array-like container on the RHS. Unless you think that `EdgesToCut` should also be a BitVector?
Ah, my mistake -- one too many `auto`s for me to trace through. This is fine.


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

https://reviews.llvm.org/D84471





More information about the llvm-commits mailing list