[PATCH] D12923: Add support for function attribute "notail"

Akira Hatanaka via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 5 19:04:58 PST 2015


ahatanak added inline comments.

================
Comment at: lib/Bitcode/Writer/BitcodeWriter.cpp:2132-2134
@@ -2131,4 +2131,5 @@
     Vals.push_back(VE.getAttributeID(CI.getAttributes()));
     Vals.push_back((CI.getCallingConv() << 1) | unsigned(CI.isTailCall()) |
-                   unsigned(CI.isMustTailCall()) << 14 | 1 << 15);
+                   unsigned(CI.isMustTailCall()) << 14 | 1 << 15 |
+                   unsigned(CI.isNoTailCall()) << 16);
     Vals.push_back(VE.getTypeID(FTy));
----------------
spatel wrote:
> Hi Akira -
> 
> Can you give these bitfields proper names in a struct or enum in LLVMBitCodes.h? It took me a while to understand why we have this encoding (no code comments...).
> 
> The other reason I ask is because I was about to swipe bit 16 myself. :)
> 
> I think that's the only backwards-compatible way to add fast-math-flags to a call ( PR21290 ). We can't use the usual method of tacking an optional field to the end of the record because the record length is unknown for a call with varargs.
Hi Sanjay.

I've made the changes you suggested in my local branch, but I think they should be in a follow-up patch to separate the changes related to notail from the changes related to the bitfield names.

These are the enums I defined in LLVMBitCodes.h:

enum CallMarkersFlags {
  CALL_TAIL = 0,
  CALL_CCONV = 1,
  CALL_MUSTTAIL = 14,
  CALL_EXPLICIT_TYPE = 15,
  CALL_NOTAIL = 16
};


http://reviews.llvm.org/D12923





More information about the llvm-commits mailing list