4 ms·
Wow thanks for the pointer! That seems unfortunate, I wonder if there is a way to evaluate whether the extra jump is actually worth it, and whether this optimi
by haberman 6y ago
Wow thanks for the pointer! That seems unfortunate, I wonder if there is a way to evaluate whether the extra jump is actually worth it, and whether this optimization could be allowed.
- chandlerc1024 6y agoAt the very least, can check when the target isn't a basic block and thus it's a clear win. Will fix your case. I'm dubious about the whole thing though. Seems like it may day from when branching "down" vs. "up" mattered to branch prediction.
- pyler 6y agoIt seems that that code handles just the case when target is function. https://github.com/llvm/llvm-project/blob/535df472b04208d6ae88e017c8f1d831fb239346/llvm/lib/Target/X86/X86InstrInfo.cpp#L2870 https://github.com/llvm/llvm-project/blob/535df472b04208d6ae...
- ndesaulniers 6y agocommit a468601e0ead ("[X86] Re-enable conditional tail calls and fix PR31257.") https://reviews.llvm.org/D29856 https://reviews.llvm.org/D29856 added the comment. If I remove the check for `OptForSize` and `PredTBB == MBB`, we can optimize OP's report, but seem to regress basic tests like llvm/test/CodeGen/X86/conditional-tailcall.ll, literally flipping the branches incorrectly IIUC. Filed: https://bugs.llvm.org/show_bug.cgi?id=50130 https://bugs.llvm.org/show_bug.cgi?id=50130