Skip to content

Commit 5a4081e

Browse files
committed
[TSAR, Memory] Minor fix.
1 parent 3af6289 commit 5a4081e

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

include/tsar/Analysis/Memory/AssumptionInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,4 @@ class AssumptionInfoPass : public FunctionPass, private bcl::Uncopyable {
6565
};
6666
}
6767

68-
#endif //TSAR_ASSUMPTION_INFO_H
68+
#endif //TSAR_ASSUMPTION_INFO_H

lib/Analysis/Memory/AssumptionInfo.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,20 +64,20 @@ void initializeAssumptions(AssumptionMap &AM, AssumptionCache &AC) {
6464
{
6565
case CmpInst::Predicate::ICMP_UGE:
6666
case CmpInst::Predicate::ICMP_SGE:
67-
Bounds.Upper = Bounds.Upper ? std::max(CV, *Bounds.Upper) : CV;
67+
Bounds.Upper = Bounds.Upper ? std::min(CV, *Bounds.Upper) : CV;
6868
break;
6969
case CmpInst::Predicate::ICMP_UGT:
7070
case CmpInst::Predicate::ICMP_SGT:
71-
Bounds.Upper = Bounds.Upper ? std::max(CV - 1, *Bounds.Upper) :
71+
Bounds.Upper = Bounds.Upper ? std::min(CV - 1, *Bounds.Upper) :
7272
CV - 1;
7373
break;
7474
case CmpInst::Predicate::ICMP_ULE:
7575
case CmpInst::Predicate::ICMP_SLE:
76-
Bounds.Lower = Bounds.Lower ? std::min(CV, *Bounds.Lower) : CV;
76+
Bounds.Lower = Bounds.Lower ? std::max(CV, *Bounds.Lower) : CV;
7777
break;
7878
case CmpInst::Predicate::ICMP_ULT:
7979
case CmpInst::Predicate::ICMP_SLT:
80-
Bounds.Lower = Bounds.Lower ? std::min(CV + 1, *Bounds.Lower) :
80+
Bounds.Lower = Bounds.Lower ? std::max(CV + 1, *Bounds.Lower) :
8181
CV + 1;
8282
break;
8383
default:

lib/Unparse/Utils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828
#include "tsar/Analysis/Memory/DIMemoryLocation.h"
2929
#include "tsar/Analysis/Memory/EstimateMemory.h"
3030
#include "tsar/Analysis/Memory/MemoryLocationRange.h"
31-
#include <llvm/Analysis/ValueTracking.h>
3231
#include "tsar/Unparse/DIUnparser.h"
3332
#include "tsar/Unparse/SourceUnparserUtils.h"
33+
#include <llvm/Analysis/ValueTracking.h>
3434
#include <llvm/IR/DebugInfo.h>
3535
#include <llvm/Support/raw_ostream.h>
3636
#include <llvm/Transforms/Utils/Local.h>

0 commit comments

Comments
 (0)