[PATCH] Add 'musttail' marker to call instructions

Nick Lewycky nlewycky at google.com
Mon Mar 31 20:27:31 PDT 2014


On 31 March 2014 20:20, David Majnemer <david.majnemer at gmail.com> wrote:

>
>
> ================
> Comment at: include/llvm/IR/Instructions.h:1291
> @@ -1281,1 +1290,3 @@
> +  }
>    void setTailCall(bool isTC = true) {
> +    setInstructionSubclassData((getSubclassDataFromInstruction() & ~3) |
> ----------------
> Wouldn't it make more sense to have `setTailCall` take an `enum
> TailCallKind` instead of having both `setTailCall` and `setTailCallKind` ?
>

The point of having setTailCall is that tail-callness is a mutable property
throughout the IR. The point of musttail is that it must be a tail call,
hence it isn't mutable.

I'm not sure whether there should be a setter at all and instead we should
require that musttail must be set at creation time and is immutable, or
whether we should permit upgrading normal-tail-call to musttail, but you
can't downgrade one.

Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140331/7cd878aa/attachment.html>


More information about the llvm-commits mailing list