[PATCH] D39262: [CodeGen] Peel off the dominant case in switch statement in lowering

Hans Wennborg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 3 08:55:03 PDT 2017


hans added inline comments.


================
Comment at: test/CodeGen/Generic/switch-lower-peel-top-case.ll:12
+    i32 129, label %sw.bb7
+  ], !prof !2
+
----------------
xur wrote:
> hans wrote:
> > xur wrote:
> > > hans wrote:
> > > > This could probably be simplified a bit. If %n were an i32 instad of i16 you don't need the sext. You could drop local_unnamed_addr.
> > > > 
> > > > The case labels look pretty random; maybe chose cases with more purpose, and rename the target blocks to match. It would also be good to test the case where two adjacent cases are merged into a cluster and peeled.
> > > This is extracted from a real program. But I agree that it should be simplified by removing the unrelated details. I will change. 
> > The part about case values, and test for peeling two adjacent cases still applies.
> Sorry I might misread your earlier comments. Do you mean I should change the case value?
Yes.

"The case labels look pretty random; maybe chose cases with more purpose, and rename the target blocks to match. It would also be good to test the case where two adjacent cases are merged into a cluster and peeled."


https://reviews.llvm.org/D39262





More information about the llvm-commits mailing list