[clang] llvm#162046 removed urem() call in rotate builtins, called rotl/rotr directly (PR #162113)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Oct 6 09:31:33 PDT 2025
https://github.com/rdez13 created https://github.com/llvm/llvm-project/pull/162113
Fixes #162046
>From 6c34a8d28f1323504009f361d88f7f4febaa8725 Mon Sep 17 00:00:00 2001
From: rdez13 <ryandezfuli at yahoo.com>
Date: Mon, 6 Oct 2025 12:21:32 -0400
Subject: [PATCH] llvm#162046 removed urem() call in rotate builtins, called
rotl/rotr directly
---
clang/lib/AST/ExprConstant.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp
index 7bf28d988f405..a9fedc1df56ce 100644
--- a/clang/lib/AST/ExprConstant.cpp
+++ b/clang/lib/AST/ExprConstant.cpp
@@ -14265,7 +14265,7 @@ bool IntExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E,
!EvaluateInteger(E->getArg(1), Amt, Info))
return false;
- return Success(Val.rotl(Amt.urem(Val.getBitWidth())), E);
+ return Success(Val.rotl(Amt), E);
}
case Builtin::BI__builtin_rotateright8:
@@ -14282,7 +14282,7 @@ bool IntExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E,
!EvaluateInteger(E->getArg(1), Amt, Info))
return false;
- return Success(Val.rotr(Amt.urem(Val.getBitWidth())), E);
+ return Success(Val.rotr(Amt), E);
}
case Builtin::BI__builtin_elementwise_add_sat: {
More information about the cfe-commits
mailing list