From f29cd154e8a89a17b5d35f7cbd2a882a5b17230c Mon Sep 17 00:00:00 2001 From: Andreas Jonson Date: Sun, 29 Jun 2025 12:26:29 +0200 Subject: [PATCH] [InstCombine] Create Icmp in canonical form (NFC) --- llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp index dce695a036006..dd16cfaeecd45 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp @@ -681,7 +681,7 @@ static Value *foldLogOpOfMaskedICmps(Value *LHS, Value *RHS, bool IsAnd, } Value *NewAnd = Builder.CreateAnd(A, BD); Value *CEVal = ConstantInt::get(A->getType(), CE); - return Builder.CreateICmp(CC, CEVal, NewAnd); + return Builder.CreateICmp(CC, NewAnd, CEVal); }; if (Mask & BMask_Mixed)