[llvm-commits] [cfe-commits] [PATCH][RFC] PR10367: don't allow GlobalAlias's aliasee to be an arbitrary Constant

Jay Foad jay.foad at gmail.com
Sun Jul 31 03:22:47 PDT 2011


On 31 July 2011 08:58, Duncan Sands <baldrick at free.fr> wrote:
>> It saves creating a bitcast ConstantExpr where none is needed.
>
> LLVM has a very regular type system.  By introducing alias as a special
> exception where types don't have to match you make LLVM IR less regular
> which is bad.  For the sake of saving a few bitcasts you are increasing
> the number of concepts:  "entities must not be multiplied beyond necessity".
>
>> Currently this has to be done by callers of GlobalAlias::setAliasee,
>> which is an unnecessary burden on them.
>
> I think a better solution is to introduce a helper function for front-end
> writers which takes care of this kind of detail for them.

In that case, I'm inclined to drop my patch and leave it to anyone
else who is motivated to work on this.

Thanks,
Jay.




More information about the llvm-commits mailing list