[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
Mon Aug 1 02:18:30 PDT 2011


>>> Since we have to accept bitcasts and geps of globals as alias operands,
>>> is there any point in allowing the result type to be different to the
>>> operand type?
>>
>> 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.

It sounds like you are arguing against PR10367:

  "Instead, the initializer of a
GlobalAlias should be required to be a GlobalValue, but the type of the source
and dest of the alias should not be required to be the same, they should just
be completely decoupled."

... not against my implementation of it.

> For the sake of saving a few bitcasts you are increasing
> the number of concepts:  "entities must not be multiplied beyond necessity".

My patch removes code from the verifier. I think this is evidence that
it doesn't complicate the rules for LLVM IR, it simplifies them.

Jay.




More information about the llvm-commits mailing list