[PATCH] D14877: Fix ICE on lowering of constexpr vector splats

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 10 15:48:14 PST 2015


rsmith added a comment.

Changes to ExprConstant and CGExprConstant appear to be pure cleanups; please check those in as a separate change.

When this is done, you should also be able to remove the `IgnoreImpCasts` and `EmitScalarConversion` calls in the `CK_VectorSplat` handling in `ScalarExprEmitter::VisitCastExpr`.


================
Comment at: lib/Sema/SemaExpr.cpp:5576
@@ +5575,3 @@
+    return ExprError();
+  return ImpCastExprToType(CastExprRes.get(), DestElemTy, CK);
+}
----------------
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.


http://reviews.llvm.org/D14877





More information about the cfe-commits mailing list