[llvm-dev] [RFC] Create llvm/Support/InternalLimits.h

David Zarzycki via llvm-dev llvm-dev at lists.llvm.org
Fri Mar 5 10:43:52 PST 2021


Hi Philip,

I just wanted jump start the discussion. That’s all. And I think we should just pay as we go. Hopefully we’ll never feel the need to subdivide the file.

Dave

-- 
Sent from my iPad

> On Mar 5, 2021, at 12:46 PM, Philip Reames <listmail at philipreames.com> wrote:
> 
> Seems like a reasonable idea, but we want to be careful to define which internal limits are in scope, and which are not.
> 
> For instance, ValueTracking has a bunch of internal scope limits for analysis purpose.  Moving those into some generic location would seem like a mistake.
> 
> Your example of alignment is a good one.
> 
> As a idea, what if we specifically restricted this to internal limits of the IR representation?  Or is that too narrow?  What other specific limits are you thinking of?
> 
> Philip
> 
>> On 3/5/21 6:05 AM, David Zarzycki via llvm-dev wrote:
>> Hello,
>> 
>> There are internal limits within LLVM that are fundamental to how LLVM operates but are defined in awkward places when it comes to library layering. I'd like to propose that we fix that with a simple "InternalLimits.h" file that contains a few essential constants.
>> 
>> For example, the maximum alignment supported by LLVM is defined by CodeGen but clang's Sema needs to know that value to enforce that users stay within bounds. That being said, clang's Sema doesn't need or want to depend on CodeGen for various good reasons.
>> 
>> If we create llvm/Support/InternalLimits.h and define the alignment limit there, then LLVM's CodeGen and clang's Sema can both include that file without Sema creating a dependency on CodeGen.
>> 
>> Thoughts?
>> Dave
>> _______________________________________________
>> LLVM Developers mailing list
>> llvm-dev at lists.llvm.org
>> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev



More information about the llvm-dev mailing list