From a7a1be11e69d83d6bc15ff5909dd1f1bff3fed7c Mon Sep 17 00:00:00 2001 From: Martin Sebor Date: Tue, 16 Aug 2022 17:10:10 -0600 Subject: [PATCH] [InstCombine] convert second std::min argument to same type as first Ensure both arguments to std::min have the same type in all data models. --- llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp b/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp index 94ce41ac1936..232ec6f586ac 100644 --- a/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp @@ -740,7 +740,7 @@ Value *LibCallSimplifier::optimizeStrLCpy(CallInst *CI, IRBuilderBase &B) { else { // Set the length of the source for the function to return to its // size, and cap NBytes at the same. - SrcLen = std::min(SrcLen, Str.size()); + SrcLen = std::min(SrcLen, uint64_t(Str.size())); NBytes = std::min(NBytes - 1, SrcLen); }