================
@@ -15576,6 +15609,38 @@ static bool isOverflowingIntegerType(ASTContext &Ctx, 
QualType T) {
   return Ctx.getIntWidth(T) >= Ctx.getIntWidth(Ctx.IntTy);
 }
 
+static Expr *ExpandAMDGPUPredicateBI(ASTContext &Ctx, CallExpr *CE) {
+  if (!CE->getBuiltinCallee())
+    return CXXBoolLiteralExpr::Create(Ctx, false, Ctx.BoolTy, 
CE->getExprLoc());
+
+  if (Ctx.getTargetInfo().getTriple().isSPIRV()) {
+    CE->setType(Ctx.getLogicalOperationType());
+    return CE;
+  }
+
+  bool P = false;
+  auto &TI = Ctx.getTargetInfo();
+
+  if (CE->getDirectCallee()->getName() == "__builtin_amdgcn_processor_is") {
----------------
AlexVlx wrote:

These are both true, and I thank you for the feedback. As a relatively weak 
retort, I will note that:
- I went for the names because it felt a bit icky to add the AMDGPU specific 
builtin header, considering we're trying to limit the scope of these; also I 
did not feel confident enough to make these generic Clang BIs (for good reason, 
as the review shows:));
- The call to this function comes after having already checked that the Callee 
is one of the predicates, `IsAMDGPUPredicateBI` and `ValidateAMDGPUPredicateBI` 
get called before, so the precondition that we are indeed dealing with the 
magical BIs is established; furthermore, we're already checking upon entry that 
the Callee is indeed a builtin, and I *believe* that builtins always have 
non-elaborated names which can always be obtained via getName - I could be 
wrong here.
Having said that, using the Builtin IDs would indeed be nicer, so I can switch 
to that, thank you for the suggestion.

https://github.com/llvm/llvm-project/pull/134016
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to