[clang] 402b3f1 - [clang][bytecode] Remove unnecessary stack operations in builtin_expect (#224288)

via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 17 08:46:40 PDT 2026


Author: Timm Baeder
Date: 2026-09-17T17:46:34+02:00
New Revision: 402b3f12f8aee7e461006c528cb1cbbc0398414a

URL: https://github.com/llvm/llvm-project/commit/402b3f12f8aee7e461006c528cb1cbbc0398414a
DIFF: https://github.com/llvm/llvm-project/commit/402b3f12f8aee7e461006c528cb1cbbc0398414a.diff

LOG: [clang][bytecode] Remove unnecessary stack operations in builtin_expect (#224288)

Added: 
    

Modified: 
    clang/lib/AST/ByteCode/InterpBuiltin.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/ByteCode/InterpBuiltin.cpp b/clang/lib/AST/ByteCode/InterpBuiltin.cpp
index b8e9abed839c6..843850af334a2 100644
--- a/clang/lib/AST/ByteCode/InterpBuiltin.cpp
+++ b/clang/lib/AST/ByteCode/InterpBuiltin.cpp
@@ -861,11 +861,9 @@ static bool interp__builtin_expect(InterpState &S, CodePtr OpPC,
   if (NumArgs == 3)
     S.Stk.discard<Floating>();
   discard(S.Stk, ArgT);
+  // Top of the stack is now the first paramter. Leave it there as the return
+  // value.
 
-  APSInt Val;
-  if (!popToAPSInt(S.Stk, ArgT, Val))
-    return false;
-  pushInteger(S, Val, Call->getType());
   return true;
 }
 


        


More information about the cfe-commits mailing list