[llvm-dev] Multi-Threading Compilers
Nicholas Krause via llvm-dev
llvm-dev at lists.llvm.org
Fri Mar 27 20:41:50 PDT 2020
On 3/27/20 11:31 PM, Chris Lattner via llvm-dev wrote:
>
>
>> On Mar 27, 2020, at 1:55 PM, David Blaikie <dblaikie at gmail.com
>> <mailto:dblaikie at gmail.com>> wrote:
>>
>> That's why I'm also wary of the idea of just having use lists empty
>> for certain types without any other special handling. However, I
>> would
>> argue that if Value::use_begin() etc. contain an assertion that fails
>> when called on one of the value types that don't have use lists, then
>> the Liskov substition principle is de facto not broken. It basically
>> leads to a situation that is as-if Value didn't have use lists in the
>> first place, and only certain sub-types had use lists.
>>
>>
>> But it doesn't - it means you write some generic code, test it with
>> some cases & looks like it generalizes to other cases (you don't want
>> to/can't test generic code with all possible generic arguments -
>> that's why substitutability is important) then the code breaks when
>> it hits a constant Value because it doesn't conform to the contract.
>
> David is exactly right. To say the same thing in another way, such a
> design point would break library based design, one of the core
> principles of LLVM that makes it so powerful.
>
> To make this explicit, a library that walks use-lists internally would
> have implicit dependencies in its APIs that some things are not
> allowed to be constants.
>
> -Chris
I'm not sure who is removing me from this discussion but please keep me
CCed to it.
Thanks,
Nick
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200327/ef28d6f6/attachment.html>
More information about the llvm-dev
mailing list