[clang] [clang][AMDGPU] Fix -ast-print crash on expanded predicate builtins (PR #199963)

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Wed May 27 09:09:01 PDT 2026


================
@@ -760,14 +760,21 @@ Expr *SemaAMDGPU::ExpandAMDGPUPredicateBuiltIn(Expr *E) {
   CallExpr *CE = cast<CallExpr>(E->IgnoreParens());
   ASTContext &Ctx = getASTContext();
   QualType BoolTy = Ctx.getLogicalOperationType();
-  llvm::APInt False = llvm::APInt::getZero(Ctx.getIntWidth(BoolTy));
-  llvm::APInt True = llvm::APInt::getAllOnes(Ctx.getIntWidth(BoolTy));
   SourceLocation Loc = CE->getExprLoc();
 
+  // A plain IntegerLiteral whose type is _Bool/bool is not a shape any other
+  // clang producer creates, and consumers (e.g. StmtPrinter) assume it cannot
+  // occur — see issue #199563.
----------------
jhuber6 wrote:

Trim up AI generated comments please.

https://github.com/llvm/llvm-project/pull/199963


More information about the cfe-commits mailing list