[PATCH] D60606: [SimpleLoopUnswitch] Implement handling of prof branch_weights metadata for SwitchInst

Alina Sbirlea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 28 11:26:37 PDT 2019


asbirlea added a comment.

I'd prefer to have Chandler approve this, since I'm not familiar with what you're trying to do here.
Some minor comments inline.



================
Comment at: llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp:750
   if (DefaultExitBB) {
     NewSI->setDefaultDest(DefaultExitBB);
+    NewSI.setSuccessorWeight(0, DefaultExitWeight);
----------------
Does this compile?


================
Comment at: llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp:793
+
     SI.setDefaultDest(LastCaseI->getCaseSuccessor());
+    SIW.setSuccessorWeight(
----------------
I find it somewhat confusing that this is making changes both through SI and SIW. But I don't really understand the SwitchInstProfBranchWeightsWrapper, so perhaps it's WAI.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D60606





More information about the llvm-commits mailing list