[PATCH] D49378: [x86/SLH] Completely rework how we sink post-load hardening past data invariant instructions to be both more correct and much more powerful.

Eric Christopher via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 16 16:12:14 PDT 2018


echristo added a comment.

As a quick change this looks ok, some thoughts for cleanup:

a) Comments match the code. You've changed a lot of code here, but none of the comments :)
b) Relatedly, function names match the code. Same comment.
c) I think the hardening of registers/loads/etc needs a better comment somewhere with what the plan is for the pass.



================
Comment at: llvm/trunk/lib/Target/X86/X86SpeculativeLoadHardening.cpp:1266
       // out subsequent loads.
-      if (EnablePostLoadHardening && canHardenPostLoad(MI) &&
+      if (EnablePostLoadHardening && isDataInvariantLoad(MI) &&
+          MI.getDesc().getNumDefs() == 1 && MI.getOperand(0).isReg() &&
----------------
Comment update? Mostly because they no longer match and while I think I know what you're going for - I'd really like every aspect of this if statement commented.


Repository:
  rL LLVM

https://reviews.llvm.org/D49378





More information about the llvm-commits mailing list