[llvm] 53c41f9 - [MemoryBuiltins] Use getAllOnesValue()

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 13 06:04:36 PDT 2024


Author: Nikita Popov
Date: 2024-08-13T15:04:23+02:00
New Revision: 53c41f95db3ab3f4a5d4562fd76f7f4115c52bad

URL: https://github.com/llvm/llvm-project/commit/53c41f95db3ab3f4a5d4562fd76f7f4115c52bad
DIFF: https://github.com/llvm/llvm-project/commit/53c41f95db3ab3f4a5d4562fd76f7f4115c52bad.diff

LOG: [MemoryBuiltins] Use getAllOnesValue()

Split out from https://github.com/llvm/llvm-project/pull/80309.

Added: 
    

Modified: 
    llvm/lib/Analysis/MemoryBuiltins.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/MemoryBuiltins.cpp b/llvm/lib/Analysis/MemoryBuiltins.cpp
index 53ed60f51fde0..e1abf5e4d885e 100644
--- a/llvm/lib/Analysis/MemoryBuiltins.cpp
+++ b/llvm/lib/Analysis/MemoryBuiltins.cpp
@@ -660,7 +660,8 @@ Value *llvm::lowerObjectSizeCall(
   if (!MustSucceed)
     return nullptr;
 
-  return ConstantInt::get(ResultType, MaxVal ? -1ULL : 0);
+  return MaxVal ? Constant::getAllOnesValue(ResultType)
+                : Constant::getNullValue(ResultType);
 }
 
 STATISTIC(ObjectVisitorArgument,


        


More information about the llvm-commits mailing list