================ @@ -336,6 +348,52 @@ class OpenACCClauseCIREmitter final return clauseNotImplemented(clause); } } + + void VisitCollapseClause(const OpenACCCollapseClause &clause) { + if constexpr (isOneOfTypes<OpTy, mlir::acc::LoopOp>) { + llvm::APInt value = + clause.getIntExpr()->EvaluateKnownConstInt(cgf.cgm.getASTContext()); + + if (value.getBitWidth() != 64) + value = value.sext(64); ---------------- erichkeane wrote:
The actual value in the APInt cannot be > 64 bits, it is the count of loop-depth and is checked elsewhere, so the compiler would have broken elsewhere if this was the case. However, the type of the expression itself could possibly be? So I'll switch this to a sextOrTrunc. https://github.com/llvm/llvm-project/pull/138576 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits