[clang] [CIR] Upstream support for logical not operations (PR #133966)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 3 10:06:31 PDT 2025
================
@@ -1358,6 +1360,33 @@ mlir::Value CIRGenFunction::emitScalarConversion(mlir::Value src,
.emitScalarConversion(src, srcTy, dstTy, loc);
}
+mlir::Value ScalarExprEmitter::VisitUnaryLNot(const UnaryOperator *e) {
+ // Perform vector logical not on comparison with zero vector.
+ if (e->getType()->isVectorType() &&
+ e->getType()->castAs<VectorType>()->getVectorKind() ==
+ VectorKind::Generic) {
+ assert(!cir::MissingFeatures::vectorType());
+ cgf.cgm.errorNYI(e->getSourceRange(), "vector logical not");
+ return {};
+ }
+
+ // Compare operand to zero.
+ mlir::Value boolVal = cgf.evaluateExprAsBool(e->getSubExpr());
----------------
erichkeane wrote:
This shouldn't be necessary AFAIK. Clang should have already converted the expression via casts to bool.
https://github.com/llvm/llvm-project/pull/133966
More information about the cfe-commits
mailing list