rjmccall added a comment.

IRGen has a strong postcondition about what IR types it expects specific from 
specific evaluations.  Scalar expression emission is expected to return a 
scalar of type `ConvertType(E->getType())`, and complex expression emission is 
expected to return a pair of scalars of type 
`ConvertType(E->getType()->castAs<ComplexType>()->getElementType())`.  The 
promoted path is an exception to this only in that it uses the promotion type 
instead of `E->getType()`.  To maintain that postcondition, it is necessary 
that promoted values do not escape from the promoted path into the unpromoted 
path.  Generally this means that, whenever we *start* promoted emission within 
an expression subtree, we must unpromote our result in.  Attempting to 
compensate for a broken postcondition in clients that are not aware of promoted 
emission would be a doomed effort; please trust my experience on this.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D113107/new/

https://reviews.llvm.org/D113107

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to