[PATCH] D14877: Fix ICE on lowering of constexpr vector splats
George Burgess IV via cfe-commits
cfe-commits at lists.llvm.org
Sun Dec 13 21:37:31 PST 2015
george.burgess.iv added inline comments.
================
Comment at: lib/Sema/SemaExpr.cpp:5576
@@ +5575,3 @@
+ return ExprError();
+ return ImpCastExprToType(CastExprRes.get(), DestElemTy, CK);
+}
----------------
rsmith wrote:
> Looking at `ScalarExprEmitter::VisitCastExpr`, it seems like we are supposed to do something slightly bizarre if the source type is `bool` and we're in OpenCL mode -- in that case we're supposed to convert `true` to -1 instead of 1. In order for ExprConstant to get that case right, we should emit the appropriate implicit cast for that conversion here -- maybe add a `CK_SignedBooleanToIntegral` and a `CK_SignedBooleanToFloating`; I don't see any nice way to express this with our existing cast kinds.
...And this behavior is only present when splatting. Joy.
http://reviews.llvm.org/D14877
More information about the cfe-commits
mailing list