From 3fad7672076069525a51dfe9e6997d88ea7048ff Mon Sep 17 00:00:00 2001 From: Alex Sepkowski <5620315+alsepkow@users.noreply.github.com> Date: Wed, 18 Jun 2025 17:48:46 -0700 Subject: [PATCH 01/19] DWARFDebugAranges.h --- include/llvm/DebugInfo/DWARF/DWARFDebugAranges.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/include/llvm/DebugInfo/DWARF/DWARFDebugAranges.h b/include/llvm/DebugInfo/DWARF/DWARFDebugAranges.h index 791f010a88..2cfe7bd6b1 100644 --- a/include/llvm/DebugInfo/DWARF/DWARFDebugAranges.h +++ b/include/llvm/DebugInfo/DWARF/DWARFDebugAranges.h @@ -32,12 +32,13 @@ class DWARFDebugAranges { void construct(); struct Range { - explicit Range(uint64_t LowPC = -1ULL, uint64_t HighPC = -1ULL, - uint32_t CUOffset = -1U) - : LowPC(LowPC), Length(HighPC - LowPC), CUOffset(CUOffset) {} + explicit Range(uint64_t LowPC = std::numeric_limits::max(), + uint64_t HighPC = std::numeric_limits::max(), + uint32_t CUOffset = -std::numeric_limits::max()) + : LowPC(LowPC), Length(HighPC - LowPC), CUOffset(CUOffset) {} void setHighPC(uint64_t HighPC) { - if (HighPC == -1ULL || HighPC <= LowPC) + if (HighPC == std::numeric_limits::max() || HighPC <= LowPC) Length = 0; else Length = HighPC - LowPC; @@ -45,7 +46,7 @@ class DWARFDebugAranges { uint64_t HighPC() const { if (Length) return LowPC + Length; - return -1ULL; + return std::numeric_limits::max(); } bool containsAddress(uint64_t Address) const { From ca9e5244c0f1aba60302d90c8e31c375f9478c78 Mon Sep 17 00:00:00 2001 From: Alex Sepkowski <5620315+alsepkow@users.noreply.github.com> Date: Wed, 18 Jun 2025 17:53:03 -0700 Subject: [PATCH 02/19] BlockFrequency.h --- include/llvm/Support/BlockFrequency.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/llvm/Support/BlockFrequency.h b/include/llvm/Support/BlockFrequency.h index 4304a253b2..837f5737c8 100644 --- a/include/llvm/Support/BlockFrequency.h +++ b/include/llvm/Support/BlockFrequency.h @@ -29,7 +29,9 @@ class BlockFrequency { BlockFrequency(uint64_t Freq = 0) : Frequency(Freq) { } /// \brief Returns the maximum possible frequency, the saturation value. - static uint64_t getMaxFrequency() { return -1ULL; } + static uint64_t getMaxFrequency() { + return std::numeric_limits::max(); + } /// \brief Returns the frequency as a fixpoint number scaled by the entry /// frequency. From 865c907f5704ba1a7c33b32d526e6cde553f0fd0 Mon Sep 17 00:00:00 2001 From: Alex Sepkowski <5620315+alsepkow@users.noreply.github.com> Date: Wed, 18 Jun 2025 17:58:22 -0700 Subject: [PATCH 03/19] LEB128.h --- include/llvm/Support/LEB128.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/llvm/Support/LEB128.h b/include/llvm/Support/LEB128.h index 1324cb82ca..742327282e 100644 --- a/include/llvm/Support/LEB128.h +++ b/include/llvm/Support/LEB128.h @@ -67,7 +67,7 @@ inline unsigned encodeULEB128(uint64_t Value, uint8_t *p, } while (Value != 0); // Pad with 0x80 and emit a null byte at the end. - if (Padding != 0) { + for (; Padding != 1; --Padding) *p++ = '\x80'; *p++ = '\x00'; @@ -103,7 +103,7 @@ inline int64_t decodeSLEB128(const uint8_t *p, unsigned *n = nullptr) { } while (Byte >= 128); // Sign extend negative numbers. if (Byte & 0x40) - Value |= (-1ULL) << Shift; + Value |= ~0ULL << Shift; if (n) *n = (unsigned)(p - orig_p); return Value; From 0bbc96866d9dfc1aece65021328d8a55075eb17a Mon Sep 17 00:00:00 2001 From: Alex Sepkowski <5620315+alsepkow@users.noreply.github.com> Date: Wed, 18 Jun 2025 18:02:17 -0700 Subject: [PATCH 04/19] LEB128.h, howd that line delete sneak in there! --- include/llvm/Support/LEB128.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/llvm/Support/LEB128.h b/include/llvm/Support/LEB128.h index 742327282e..4feb88126c 100644 --- a/include/llvm/Support/LEB128.h +++ b/include/llvm/Support/LEB128.h @@ -67,7 +67,7 @@ inline unsigned encodeULEB128(uint64_t Value, uint8_t *p, } while (Value != 0); // Pad with 0x80 and emit a null byte at the end. - + if (Padding != 0) { for (; Padding != 1; --Padding) *p++ = '\x80'; *p++ = '\x00'; From d481f3e6eaa71f100eb159d60e261a001873cf1b Mon Sep 17 00:00:00 2001 From: Alex Sepkowski <5620315+alsepkow@users.noreply.github.com> Date: Wed, 18 Jun 2025 18:04:00 -0700 Subject: [PATCH 05/19] LoopAccessAnalysis.cpp --- lib/Analysis/LoopAccessAnalysis.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Analysis/LoopAccessAnalysis.cpp b/lib/Analysis/LoopAccessAnalysis.cpp index d6316dc75b..7e5e3e5ebd 100644 --- a/lib/Analysis/LoopAccessAnalysis.cpp +++ b/lib/Analysis/LoopAccessAnalysis.cpp @@ -1179,7 +1179,7 @@ bool MemoryDepChecker::areDepsSafe(DepCandidates &AccessSets, MemAccessInfoSet &CheckDeps, const ValueToValueMap &Strides) { - MaxSafeDepDistBytes = -1U; + MaxSafeDepDistBytes = std::numeric_limits::max(); while (!CheckDeps.empty()) { MemAccessInfo CurAccess = *CheckDeps.begin(); From 576750e8e4a4725c2438ff51434d1a43c8921f8c Mon Sep 17 00:00:00 2001 From: Alex Sepkowski <5620315+alsepkow@users.noreply.github.com> Date: Wed, 18 Jun 2025 18:50:40 -0700 Subject: [PATCH 06/19] InstructionCombining.cpp --- lib/Transforms/InstCombine/InstructionCombining.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Transforms/InstCombine/InstructionCombining.cpp b/lib/Transforms/InstCombine/InstructionCombining.cpp index 6bc322fa92..c93232b67f 100644 --- a/lib/Transforms/InstCombine/InstructionCombining.cpp +++ b/lib/Transforms/InstCombine/InstructionCombining.cpp @@ -1937,7 +1937,8 @@ Instruction *InstCombiner::visitAllocSite(Instruction &MI) { } else if (IntrinsicInst *II = dyn_cast(I)) { if (II->getIntrinsicID() == Intrinsic::objectsize) { ConstantInt *CI = cast(II->getArgOperand(1)); - uint64_t DontKnow = CI->isZero() ? -1ULL : 0; + uint64_t DontKnow = + CI->isZero() ? std::numeric_limits::max() : 0; ReplaceInstUsesWith(*I, ConstantInt::get(I->getType(), DontKnow)); } } From 2d0dd68318b92bd01d679d45341bfbb6678e2d84 Mon Sep 17 00:00:00 2001 From: Alex Sepkowski <5620315+alsepkow@users.noreply.github.com> Date: Wed, 18 Jun 2025 18:52:46 -0700 Subject: [PATCH 07/19] LoadCombine.cpp --- lib/Transforms/Scalar/LoadCombine.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Transforms/Scalar/LoadCombine.cpp b/lib/Transforms/Scalar/LoadCombine.cpp index 6d358744ef..8f22bb337d 100644 --- a/lib/Transforms/Scalar/LoadCombine.cpp +++ b/lib/Transforms/Scalar/LoadCombine.cpp @@ -131,10 +131,10 @@ bool LoadCombine::aggregateLoads(SmallVectorImpl &Loads) { LoadInst *BaseLoad = nullptr; SmallVector AggregateLoads; bool Combined = false; - uint64_t PrevOffset = -1ull; + uint64_t PrevOffset = std::numeric_limits::max(); uint64_t PrevSize = 0; for (auto &L : Loads) { - if (PrevOffset == -1ull) { + if (PrevOffset == std::numeric_limits::max()) { BaseLoad = L.Load; PrevOffset = L.POP.Offset; PrevSize = L.Load->getModule()->getDataLayout().getTypeStoreSize( From 781b590d821970aed38e246fbd30f78c4006b34e Mon Sep 17 00:00:00 2001 From: Alex Sepkowski <5620315+alsepkow@users.noreply.github.com> Date: Wed, 18 Jun 2025 18:55:22 -0700 Subject: [PATCH 08/19] Expr.h --- tools/clang/include/clang/AST/Expr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/clang/include/clang/AST/Expr.h b/tools/clang/include/clang/AST/Expr.h index 26eff309f7..7a601257d8 100644 --- a/tools/clang/include/clang/AST/Expr.h +++ b/tools/clang/include/clang/AST/Expr.h @@ -4510,7 +4510,7 @@ class GenericSelectionExpr : public Expr { Expr *getControllingExpr() { return cast(SubExprs[CONTROLLING]); } /// Whether this generic selection is result-dependent. - bool isResultDependent() const { return ResultIndex == -1U; } + bool isResultDependent() const { return ResultIndex == std::numeric_limits::max(); } /// The zero-based index of the result expression's generic association in /// the generic selection's association list. Defined only if the From c66097bc4ecb6f614b902f93a086006d3cc787a6 Mon Sep 17 00:00:00 2001 From: Alex Sepkowski <5620315+alsepkow@users.noreply.github.com> Date: Wed, 18 Jun 2025 18:55:47 -0700 Subject: [PATCH 09/19] Expr.h clang format --- tools/clang/include/clang/AST/Expr.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/clang/include/clang/AST/Expr.h b/tools/clang/include/clang/AST/Expr.h index 7a601257d8..55fd184a79 100644 --- a/tools/clang/include/clang/AST/Expr.h +++ b/tools/clang/include/clang/AST/Expr.h @@ -4510,7 +4510,9 @@ class GenericSelectionExpr : public Expr { Expr *getControllingExpr() { return cast(SubExprs[CONTROLLING]); } /// Whether this generic selection is result-dependent. - bool isResultDependent() const { return ResultIndex == std::numeric_limits::max(); } + bool isResultDependent() const { + return ResultIndex == std::numeric_limits::max(); + } /// The zero-based index of the result expression's generic association in /// the generic selection's association list. Defined only if the From 5c5beaebe50f97b69402338d3894036cb9b377e0 Mon Sep 17 00:00:00 2001 From: Alex Sepkowski <5620315+alsepkow@users.noreply.github.com> Date: Wed, 18 Jun 2025 18:59:40 -0700 Subject: [PATCH 10/19] Expr.cpp with clang-format changes --- tools/clang/lib/AST/Expr.cpp | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/tools/clang/lib/AST/Expr.cpp b/tools/clang/lib/AST/Expr.cpp index 8ed14508af..2d039a7e98 100644 --- a/tools/clang/lib/AST/Expr.cpp +++ b/tools/clang/lib/AST/Expr.cpp @@ -3883,25 +3883,21 @@ GenericSelectionExpr::GenericSelectionExpr(const ASTContext &Context, std::copy(AssocExprs.begin(), AssocExprs.end(), SubExprs+END_EXPR); } -GenericSelectionExpr::GenericSelectionExpr(const ASTContext &Context, - SourceLocation GenericLoc, Expr *ControllingExpr, - ArrayRef AssocTypes, - ArrayRef AssocExprs, - SourceLocation DefaultLoc, - SourceLocation RParenLoc, - bool ContainsUnexpandedParameterPack) - : Expr(GenericSelectionExprClass, - Context.DependentTy, - VK_RValue, - OK_Ordinary, - /*isTypeDependent=*/true, - /*isValueDependent=*/true, - /*isInstantiationDependent=*/true, - ContainsUnexpandedParameterPack), - AssocTypes(new (Context) TypeSourceInfo*[AssocTypes.size()]), - SubExprs(new (Context) Stmt*[END_EXPR+AssocExprs.size()]), - NumAssocs(AssocExprs.size()), ResultIndex(-1U), GenericLoc(GenericLoc), - DefaultLoc(DefaultLoc), RParenLoc(RParenLoc) { +GenericSelectionExpr::GenericSelectionExpr( + const ASTContext &Context, SourceLocation GenericLoc, Expr *ControllingExpr, + ArrayRef AssocTypes, ArrayRef AssocExprs, + SourceLocation DefaultLoc, SourceLocation RParenLoc, + bool ContainsUnexpandedParameterPack) + : Expr(GenericSelectionExprClass, Context.DependentTy, VK_RValue, + OK_Ordinary, + /*isTypeDependent=*/true, + /*isValueDependent=*/true, + /*isInstantiationDependent=*/true, ContainsUnexpandedParameterPack), + AssocTypes(new(Context) TypeSourceInfo *[AssocTypes.size()]), + SubExprs(new(Context) Stmt *[END_EXPR + AssocExprs.size()]), + NumAssocs(AssocExprs.size()), + ResultIndex(std::numeric_limits::max()), GenericLoc(GenericLoc), + DefaultLoc(DefaultLoc), RParenLoc(RParenLoc) { SubExprs[CONTROLLING] = ControllingExpr; assert(AssocTypes.size() == AssocExprs.size()); std::copy(AssocTypes.begin(), AssocTypes.end(), this->AssocTypes); From 8af4b0c0c80cb16b7f6e083d057c0437e17bb5f5 Mon Sep 17 00:00:00 2001 From: Alex Sepkowski <5620315+alsepkow@users.noreply.github.com> Date: Wed, 18 Jun 2025 19:03:00 -0700 Subject: [PATCH 11/19] CGExprScalar.cpp with clang format --- tools/clang/lib/CodeGen/CGExprScalar.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/clang/lib/CodeGen/CGExprScalar.cpp b/tools/clang/lib/CodeGen/CGExprScalar.cpp index 530c791fcc..b199eef829 100644 --- a/tools/clang/lib/CodeGen/CGExprScalar.cpp +++ b/tools/clang/lib/CodeGen/CGExprScalar.cpp @@ -2559,7 +2559,8 @@ void ScalarExprEmitter::EmitUndefinedBehaviorIntegerDivAndRemCheck( llvm::Value *IntMin = Builder.getInt(llvm::APInt::getSignedMinValue(Ty->getBitWidth())); - llvm::Value *NegOne = llvm::ConstantInt::get(Ty, -1ULL); + llvm::Value *NegOne = + llvm::ConstantInt::get(Ty, std::numeric_limits::min()); llvm::Value *LHSCmp = Builder.CreateICmpNE(Ops.LHS, IntMin); llvm::Value *RHSCmp = Builder.CreateICmpNE(Ops.RHS, NegOne); From 4919a174888c56da0bc14300f1770b46c5fe0661 Mon Sep 17 00:00:00 2001 From: Alex Sepkowski <5620315+alsepkow@users.noreply.github.com> Date: Wed, 18 Jun 2025 19:05:39 -0700 Subject: [PATCH 12/19] Lexer.cpp --- tools/clang/lib/Lex/Lexer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/clang/lib/Lex/Lexer.cpp b/tools/clang/lib/Lex/Lexer.cpp index 089e76b78b..e39573ca34 100644 --- a/tools/clang/lib/Lex/Lexer.cpp +++ b/tools/clang/lib/Lex/Lexer.cpp @@ -2737,7 +2737,7 @@ uint32_t Lexer::tryReadUCN(const char *&StartPtr, const char *SlashLoc, char C = getCharAndSize(CurPtr, CharSize); unsigned Value = llvm::hexDigitValue(C); - if (Value == -1U) { + if (Value == std::numeric_limits::max()) { if (Result && !isLexingRawMode()) { if (i == 0) { Diag(BufferPtr, diag::warn_ucn_escape_no_digits) From a3efb769ae06a8f38b3e92cb9e412fc77ca2f47e Mon Sep 17 00:00:00 2001 From: Alex Sepkowski <5620315+alsepkow@users.noreply.github.com> Date: Wed, 18 Jun 2025 19:07:36 -0700 Subject: [PATCH 13/19] SemaExpr.cpp with clang format --- tools/clang/lib/Sema/SemaExpr.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/clang/lib/Sema/SemaExpr.cpp b/tools/clang/lib/Sema/SemaExpr.cpp index 389fcfc3ff..d5d20e49b1 100644 --- a/tools/clang/lib/Sema/SemaExpr.cpp +++ b/tools/clang/lib/Sema/SemaExpr.cpp @@ -1466,7 +1466,7 @@ Sema::CreateGenericSelectionExpr(SourceLocation KeyLoc, ContainsUnexpandedParameterPack); SmallVector CompatIndices; - unsigned DefaultIndex = -1U; + unsigned DefaultIndex = std::numeric_limits::max(); for (unsigned i = 0; i < NumAssocs; ++i) { if (!Types[i]) DefaultIndex = i; @@ -1498,7 +1498,8 @@ Sema::CreateGenericSelectionExpr(SourceLocation KeyLoc, // C11 6.5.1.1p2 "If a generic selection has no default generic association, // its controlling expression shall have type compatible with exactly one of // the types named in its generic association list." - if (DefaultIndex == -1U && CompatIndices.size() == 0) { + if (DefaultIndex == std::numeric_limits::max() && + CompatIndices.size() == 0) { // We strip parens here because the controlling expression is typically // parenthesized in macro definitions. ControllingExpr = ControllingExpr->IgnoreParens(); From 59a44e6d118427deef69c34cdb95b128183727f6 Mon Sep 17 00:00:00 2001 From: Alex Sepkowski <5620315+alsepkow@users.noreply.github.com> Date: Wed, 18 Jun 2025 19:09:14 -0700 Subject: [PATCH 14/19] SemaType.cpp --- tools/clang/lib/Sema/SemaType.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/clang/lib/Sema/SemaType.cpp b/tools/clang/lib/Sema/SemaType.cpp index ff3b0dbac7..f08ae486b5 100644 --- a/tools/clang/lib/Sema/SemaType.cpp +++ b/tools/clang/lib/Sema/SemaType.cpp @@ -462,7 +462,7 @@ distributeObjCPointerTypeAttrFromDeclarator(TypeProcessingState &state, // objc_gc goes on the innermost pointer to something that's not a // pointer. - unsigned innermost = -1U; + unsigned innermost = std::numeric_limits::max(); bool considerDeclSpec = true; for (unsigned i = 0, e = declarator.getNumTypeObjects(); i != e; ++i) { DeclaratorChunk &chunk = declarator.getTypeObject(i); @@ -501,7 +501,7 @@ distributeObjCPointerTypeAttrFromDeclarator(TypeProcessingState &state, // Otherwise, if we found an appropriate chunk, splice the attribute // into it. - if (innermost != -1U) { + if (innermost != std::numeric_limits::max()) { moveAttrFromListToList(attr, declarator.getAttrListRef(), declarator.getTypeObject(innermost).getAttrListRef()); return; From d81dba664f9fec6ce9b54988a26e7c932592cfe2 Mon Sep 17 00:00:00 2001 From: Alex Sepkowski <5620315+alsepkow@users.noreply.github.com> Date: Wed, 18 Jun 2025 19:10:57 -0700 Subject: [PATCH 15/19] FixedLenDecoderEmitter.cpp with clang format --- utils/TableGen/FixedLenDecoderEmitter.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/utils/TableGen/FixedLenDecoderEmitter.cpp b/utils/TableGen/FixedLenDecoderEmitter.cpp index c5ef9d0e99..d356971f24 100644 --- a/utils/TableGen/FixedLenDecoderEmitter.cpp +++ b/utils/TableGen/FixedLenDecoderEmitter.cpp @@ -547,10 +547,11 @@ void Filter::recurse() { // Delegates to an inferior filter chooser for further processing on this // group of instructions whose segment values are variable. - FilterChooserMap.insert( - std::make_pair(-1U, llvm::make_unique( - Owner->AllInstructions, VariableInstructions, - Owner->Operands, BitValueArray, *Owner))); + FilterChooserMap.insert(std::make_pair( + std::numeric_limits::max(), + llvm::make_unique(Owner->AllInstructions, + VariableInstructions, Owner->Operands, + BitValueArray, *Owner))); } // No need to recurse for a singleton filtered instruction. From 10f0ab4c7789aa267740888c675a7776933a7abe Mon Sep 17 00:00:00 2001 From: Alex Sepkowski <5620315+alsepkow@users.noreply.github.com> Date: Thu, 19 Jun 2025 09:52:54 -0700 Subject: [PATCH 16/19] Update to DWARFDebugAranges.h --- include/llvm/DebugInfo/DWARF/DWARFDebugAranges.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/llvm/DebugInfo/DWARF/DWARFDebugAranges.h b/include/llvm/DebugInfo/DWARF/DWARFDebugAranges.h index 2cfe7bd6b1..c34cfab284 100644 --- a/include/llvm/DebugInfo/DWARF/DWARFDebugAranges.h +++ b/include/llvm/DebugInfo/DWARF/DWARFDebugAranges.h @@ -34,7 +34,7 @@ class DWARFDebugAranges { struct Range { explicit Range(uint64_t LowPC = std::numeric_limits::max(), uint64_t HighPC = std::numeric_limits::max(), - uint32_t CUOffset = -std::numeric_limits::max()) + uint32_t CUOffset = std::numeric_limits::max()) : LowPC(LowPC), Length(HighPC - LowPC), CUOffset(CUOffset) {} void setHighPC(uint64_t HighPC) { From 66e03890e75a7038b7d91bd289f78c266cd5e52e Mon Sep 17 00:00:00 2001 From: Alex Sepkowski <5620315+alsepkow@users.noreply.github.com> Date: Thu, 19 Jun 2025 10:54:46 -0700 Subject: [PATCH 17/19] Fix the type and min to max in CGRExprScalar.cpp --- tools/clang/lib/CodeGen/CGExprScalar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/clang/lib/CodeGen/CGExprScalar.cpp b/tools/clang/lib/CodeGen/CGExprScalar.cpp index b199eef829..91f116f8ef 100644 --- a/tools/clang/lib/CodeGen/CGExprScalar.cpp +++ b/tools/clang/lib/CodeGen/CGExprScalar.cpp @@ -2560,7 +2560,7 @@ void ScalarExprEmitter::EmitUndefinedBehaviorIntegerDivAndRemCheck( llvm::Value *IntMin = Builder.getInt(llvm::APInt::getSignedMinValue(Ty->getBitWidth())); llvm::Value *NegOne = - llvm::ConstantInt::get(Ty, std::numeric_limits::min()); + llvm::ConstantInt::get(Ty, std::numeric_limits::min()); llvm::Value *LHSCmp = Builder.CreateICmpNE(Ops.LHS, IntMin); llvm::Value *RHSCmp = Builder.CreateICmpNE(Ops.RHS, NegOne); From 68ac0b23327eac5d4b99ea35b6b9873a3620f85f Mon Sep 17 00:00:00 2001 From: Alex Sepkowski <5620315+alsepkow@users.noreply.github.com> Date: Thu, 19 Jun 2025 16:16:00 -0700 Subject: [PATCH 18/19] Another mistaken min instead of max in CGExprScalar.cpp --- tools/clang/lib/CodeGen/CGExprScalar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/clang/lib/CodeGen/CGExprScalar.cpp b/tools/clang/lib/CodeGen/CGExprScalar.cpp index 91f116f8ef..50aae94505 100644 --- a/tools/clang/lib/CodeGen/CGExprScalar.cpp +++ b/tools/clang/lib/CodeGen/CGExprScalar.cpp @@ -2560,7 +2560,7 @@ void ScalarExprEmitter::EmitUndefinedBehaviorIntegerDivAndRemCheck( llvm::Value *IntMin = Builder.getInt(llvm::APInt::getSignedMinValue(Ty->getBitWidth())); llvm::Value *NegOne = - llvm::ConstantInt::get(Ty, std::numeric_limits::min()); + llvm::ConstantInt::get(Ty, std::numeric_limits::max()); llvm::Value *LHSCmp = Builder.CreateICmpNE(Ops.LHS, IntMin); llvm::Value *RHSCmp = Builder.CreateICmpNE(Ops.RHS, NegOne); From b03bc56c0a4eff1f3fb5f835f447400f7cebbe3b Mon Sep 17 00:00:00 2001 From: Alex Sepkowski <5620315+alsepkow@users.noreply.github.com> Date: Fri, 20 Jun 2025 14:25:10 -0700 Subject: [PATCH 19/19] Include in BlockFrequency.h --- include/llvm/Support/BlockFrequency.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/llvm/Support/BlockFrequency.h b/include/llvm/Support/BlockFrequency.h index 837f5737c8..d7d6d741f4 100644 --- a/include/llvm/Support/BlockFrequency.h +++ b/include/llvm/Support/BlockFrequency.h @@ -15,6 +15,7 @@ #define LLVM_SUPPORT_BLOCKFREQUENCY_H #include "llvm/Support/DataTypes.h" +#include namespace llvm {