[llvm-dev] PointerIntPair

Paul C. Anagnostopoulos via llvm-dev llvm-dev at lists.llvm.org
Thu Dec 31 10:21:36 PST 2020


The TableGen field value (RecordVal) class includes a PointerIntPair. The integer is a boolean that specifies whether the field was defined with the 'field' prefix.

I'd like to add another boolean to RecordVal to specify whether the field is actually a template argument. I could make the Int an enum instead, with three elements. That would require 2 bits. I see this has been done elsewhere.

What do people think about PointerIntPair? Is it a good thing to use? I could simply add the enum as a new data item in the RecordVal, but I estimate this could add 10--12 MB to the memory requirement of TableGen. (The AMDGPU target's TableGen files result in about 3 million record fields.)

While I'm here, let me ask how the PointerIntPair works at all. Does every target guarantee at least 4-byte alignment of stack/heap objects?



More information about the llvm-dev mailing list