[PATCH] D139565: [IR] add new callbrpad instruction

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 7 14:52:56 PST 2022


efriedma added a comment.

As a general rule, I prioritize making the IR less awkward to deal with, vs. making things easier for SelectionDAG.

> To expand on this; we might like to conceptually have one value %0 in llvm ir, but in MIR, we'd need either a distinct virtreg per edge

Yes, it would require some sort of translation.

> See @test5 added in llvm/test/CodeGen/X86/callbr-asm-outputs-indirect-isel.ll, which is a case of common direct and indirect destination. We wind up with superfluous copies in the parent MBB, but the correct registers from expanding the callbrpad. It's not the most optimal code immediately after isel, but it looks correct to me, and those dead copies do get wiped out by later passes.

I suspect it doesn't really work in general, but I'm not sure off the top of my head what actually breaks.  It's hard to reason about, in any case.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D139565



More information about the llvm-commits mailing list