[PATCH] D24108: X86: Fold tail calls into conditional branches where possible (PR26302)

Michael Kuperstein via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 7 10:29:34 PDT 2016


mkuper accepted this revision.
mkuper added a comment.
This revision is now accepted and ready to land.

LGTM


================
Comment at: lib/Target/X86/X86InstrInfo.cpp:4079
@@ -4010,2 +4078,3 @@
+
 // Given a MBB and its TBB, find the FBB which was a fallthrough MBB (it may
 // not be a fallthrough MBB now due to layout changes). Return nullptr if the
----------------
Yeah, you're right, I can't think of a really nice way to handle this, since the analyzeBranches() call is in in a generic part of this patch, not x86-specific. And the search here should normally be really short anyway.

But could you please leave a comment documenting this, in case someone decides to refactor this later.


================
Comment at: test/CodeGen/X86/conditional-tailcall.ll:22
@@ +21,3 @@
+; Check that the asm doesn't just look good, but uses the correct encoding.
+; CHECK: encoding: [0x75,A]
+
----------------
I'm a bit confused about this. Without the change to X86MCInstLower, I'd expect you to get complete nonsense, not a poorly encoded jmp.
Anyway, that's a problem with my understanding of this, not your patch. :-)


https://reviews.llvm.org/D24108





More information about the llvm-commits mailing list