[llvm] 80910d6 - [IVDescriptors] Pass IsSigned when creating an all 1s constant for UMin recurrence.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 8 09:56:19 PST 2023


Author: Craig Topper
Date: 2023-03-08T09:52:42-08:00
New Revision: 80910d6ceb5f45b5d522da8bddd0b88e3280aa07

URL: https://github.com/llvm/llvm-project/commit/80910d6ceb5f45b5d522da8bddd0b88e3280aa07
DIFF: https://github.com/llvm/llvm-project/commit/80910d6ceb5f45b5d522da8bddd0b88e3280aa07.diff

LOG: [IVDescriptors] Pass IsSigned when creating an all 1s constant for UMin recurrence.

This only matters for types larger than i64, and is consistent with
the code for RecurKind::And which also creates all 1s.

We don't have any tests for UMin or And with types larger than i64.

Added: 
    

Modified: 
    llvm/lib/Analysis/IVDescriptors.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/IVDescriptors.cpp b/llvm/lib/Analysis/IVDescriptors.cpp
index 38b1a1d0b0bb..156d141c461e 100644
--- a/llvm/lib/Analysis/IVDescriptors.cpp
+++ b/llvm/lib/Analysis/IVDescriptors.cpp
@@ -1107,7 +1107,7 @@ Value *RecurrenceDescriptor::getRecurrenceIdentity(RecurKind K, Type *Tp,
       return ConstantFP::get(Tp, 0.0L);
     return ConstantFP::get(Tp, -0.0L);
   case RecurKind::UMin:
-    return ConstantInt::get(Tp, -1);
+    return ConstantInt::get(Tp, -1, true);
   case RecurKind::UMax:
     return ConstantInt::get(Tp, 0);
   case RecurKind::SMin:


        


More information about the llvm-commits mailing list