[PATCH 1/1] R600: Fix function name printing in LowerCall

Matt Arsenault Matthew.Arsenault at amd.com
Fri Apr 25 14:13:35 PDT 2014


On 04/25/2014 02:05 PM, Jan Vesely wrote:
> Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
> ---
>
> Hi Matt,
>
> this patch fixes printing of RTLIB calls. I don't know what your original
> usecase was. Can you check whether it still works with this patch?
> Checking ExternalSymbol name can be added as an alternative to GlobalAddress.
>
> regards,
> Jan
>
>   lib/Target/R600/AMDGPUISelLowering.cpp | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/lib/Target/R600/AMDGPUISelLowering.cpp b/lib/Target/R600/AMDGPUISelLowering.cpp
> index d004de6..ab0dc46 100644
> --- a/lib/Target/R600/AMDGPUISelLowering.cpp
> +++ b/lib/Target/R600/AMDGPUISelLowering.cpp
> @@ -365,8 +365,8 @@ SDValue AMDGPUTargetLowering::LowerCall(CallLoweringInfo &CLI,
>   
>     StringRef FuncName("<unknown>");
>   
> -  if (const GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(Callee))
> -    FuncName = G->getGlobal()->getName();
> +  if (const ExternalSymbolSDNode *G = dyn_cast<ExternalSymbolSDNode>(Callee))
> +    FuncName = G->getSymbol();
>   
>     DiagnosticInfoUnsupported NoCalls(Fn, "call to function " + FuncName);
>     DAG.getContext()->diagnose(NoCalls);

I originally checked both ExternalSymbolSDNode and GlobalAddressSDNode, but then ExternalSymbolSDNode
  wasn't used in cases I expected it to be. The testcase I added then should work. You probably do need both; I'm guessing with your patch my testcase breaks, and you should check both cases instead of replacing it.




More information about the llvm-commits mailing list