[PATCH] D20376: Properly set CLI.NumFixedArgs for mem{set, move, cpy} builtins in SelectionDAG

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 9 12:02:12 PDT 2016


Krzysztof Parzyszek via llvm-commits <llvm-commits at lists.llvm.org>
writes:
> kparzysz created this revision.
> kparzysz added a reviewer: joker.eph.
> kparzysz added a subscriber: llvm-commits.
> kparzysz set the repository for this revision to rL LLVM.
>
> The NumFixedArgs will be set by the CLI::setCallee function, do not
> force it to be 0 for these builtins.

What is the actual effect of this change? There are a lot of other
places that call setCallee in the same way, so shouldn't we update all
of them too?

In fact, I'm not really convinced that we need to pass this argument
here at all - When don't we want Args.size()?

> Repository:
>   rL LLVM
>
> http://reviews.llvm.org/D20376
>
> Files:
>   lib/CodeGen/SelectionDAG/SelectionDAG.cpp
>
> Index: lib/CodeGen/SelectionDAG/SelectionDAG.cpp
> ===================================================================
> --- lib/CodeGen/SelectionDAG/SelectionDAG.cpp
> +++ lib/CodeGen/SelectionDAG/SelectionDAG.cpp
> @@ -4656,7 +4656,7 @@
>                   Dst.getValueType().getTypeForEVT(*getContext()),
>                   getExternalSymbol(TLI->getLibcallName(RTLIB::MEMCPY),
>                                     TLI->getPointerTy(getDataLayout())),
> -                 std::move(Args), 0)
> +                 std::move(Args))
>        .setDiscardResult()
>        .setTailCall(isTailCall);
>  
> @@ -4717,7 +4717,7 @@
>                   Dst.getValueType().getTypeForEVT(*getContext()),
>                   getExternalSymbol(TLI->getLibcallName(RTLIB::MEMMOVE),
>                                     TLI->getPointerTy(getDataLayout())),
> -                 std::move(Args), 0)
> +                 std::move(Args))
>        .setDiscardResult()
>        .setTailCall(isTailCall);
>  
> @@ -4779,7 +4779,7 @@
>                   Dst.getValueType().getTypeForEVT(*getContext()),
>                   getExternalSymbol(TLI->getLibcallName(RTLIB::MEMSET),
>                                     TLI->getPointerTy(getDataLayout())),
> -                 std::move(Args), 0)
> +                 std::move(Args))
>        .setDiscardResult()
>        .setTailCall(isTailCall);
>  
>


More information about the llvm-commits mailing list