[PATCH] D140160: [llvm][SelectionDAGBuilder] codegen callbr.landingpad intrinsic

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 13 16:04:33 PST 2023


nickdesaulniers added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:11680
+
+    SDValue V = DAG.getCopyFromReg(Chain, getCurSDLoc(), Output, ResultVTs[i]);
+    ResultValues.push_back(V);
----------------
efriedma wrote:
> efriedma wrote:
> > nickdesaulniers wrote:
> > > Another issue I'm hitting in real world kernel code is that this MVT is potentially not legal.
> > > 
> > > ```
> > > void strncpy_from_kernel_nofault_count() {
> > >   asm goto("" : "=r"(*(char *)0) : : : Efault);
> > > Efault:
> > > }
> > > ```
> > > when target powerpc64le-linux-gnu, the MVT here is i8, but the first legal MVT for the constraint's register class is i32.
> > Is that the only problem here?  Consider:
> > 
> > ```
> > void test(int *x) {
> >   asm goto("mov $0, %0" : "=r"(*x) : : : X);
> > X:;
> > }
> > ```
> Err, nevermind, got confused.
> 
> You might need to look at the logic we use to compute the types of inline asm calls.
Ok, I've basically rewritten this method in: https://reviews.llvm.org/D143961. PTAL.

(I might try again to squash D142940 and D143961 into their respective parent commits in this series)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140160



More information about the llvm-commits mailing list