[clang] 24d41c1 - [clang][bytecode] VisitBuiltinCallExpr - remove urem() call in rotate builtins, call rotl/rotr directly (#162113)

via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 6 12:42:49 PDT 2025


Author: rdez13
Date: 2025-10-06T19:42:45Z
New Revision: 24d41c1a7d7c6e982b025c93db9123b249027abf

URL: https://github.com/llvm/llvm-project/commit/24d41c1a7d7c6e982b025c93db9123b249027abf
DIFF: https://github.com/llvm/llvm-project/commit/24d41c1a7d7c6e982b025c93db9123b249027abf.diff

LOG: [clang][bytecode] VisitBuiltinCallExpr - remove urem() call in rotate builtins, call rotl/rotr directly (#162113)

Fixes #162046

Added: 
    

Modified: 
    clang/lib/AST/ExprConstant.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp
index 0b23eeda77597..618e1636e9e53 100644
--- a/clang/lib/AST/ExprConstant.cpp
+++ b/clang/lib/AST/ExprConstant.cpp
@@ -14356,7 +14356,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:
@@ -14373,7 +14373,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