Fix i386 Calling llvm.experimental.patchpoint.i64

Philip Reames listmail at philipreames.com
Fri Jun 26 14:12:35 PDT 2015


The patch itself looks fine, but I'm a bit concerned about the presence 
of the extra copy to reg.  Would you mind posting the MI that trips 
this?  It makes me wondering if we're missing something else.  In 
particular, the code for statepoint lowering - which is doing something 
very analogous - has non overlapping cases.

For the patch itself, LGTM.

Philip


On 06/21/2015 07:19 PM, lin zuojian wrote:
> Hi,
>      I try to call llvm.experimental.patchpoint.i64 on i386 arch, and
>      it crashes. I figure out this is because there are two CopyFromReg
>      node instead of one on i386 arch. So I make a patch:
> Index: test/CodeGen/X86/patchpoint-i386.ll
> ===================================================================
> --- test/CodeGen/X86/patchpoint-i386.ll	(revision 0)
> +++ test/CodeGen/X86/patchpoint-i386.ll	(working copy)
> @@ -0,0 +1,8 @@
> +; RUN: llc < %s -mtriple=i386-linux-gnu | FileCheck %s
> +
> +define fastcc i64 @main() {
> +  %1 = call i64 (i64, i32, i8*, i32, ...) @llvm.experimental.patchpoint.i64(i64 1, i32 10, i8* null, i32 0)
> +  ret i64 %1
> +}
> +
> +declare i64 @llvm.experimental.patchpoint.i64(i64, i32, i8*, i32, ...)
>
> Property changes on: test/CodeGen/X86/patchpoint-i386.ll
> ___________________________________________________________________
> Added: svn:executable
> ## -0,0 +1 ##
> +*
> \ No newline at end of property
> Index: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
> ===================================================================
> --- lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp	(revision 240022)
> +++ lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp	(working copy)
> @@ -6591,7 +6591,7 @@
>                         LandingPad, true);
>   
>     SDNode *CallEnd = Result.second.getNode();
> -  if (HasDef && (CallEnd->getOpcode() == ISD::CopyFromReg))
> +  while (HasDef && (CallEnd->getOpcode() == ISD::CopyFromReg))
>       CallEnd = CallEnd->getOperand(0).getNode();
>   
>     /// Get a call instruction from the call sequence chain.
>
>
> --
> Lin Zuojian
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list