[llvm] d57a344 - Revert "[Attributor][FIX] Allow negative offsets for ranges"
Mitch Phillips via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 16 17:57:30 PST 2022
Author: Mitch Phillips
Date: 2022-12-16T17:56:00-08:00
New Revision: d57a3443f3e2b423fd7f5402f017dc7c0dff8cdf
URL: https://github.com/llvm/llvm-project/commit/d57a3443f3e2b423fd7f5402f017dc7c0dff8cdf
DIFF: https://github.com/llvm/llvm-project/commit/d57a3443f3e2b423fd7f5402f017dc7c0dff8cdf.diff
LOG: Revert "[Attributor][FIX] Allow negative offsets for ranges"
This reverts commit 88f9b525085b4292080aec6aba835801ca5793b6.
Reason: This change is dependent on a commit that needs to be rolled
back because it broke the ASan buildbot. See
https://reviews.llvm.org/rGfc21f2d7bae2e0be630470cc7ca9323ed5859892 for
more information.
Added:
Modified:
llvm/include/llvm/Transforms/IPO/Attributor.h
Removed:
llvm/test/Transforms/Attributor/reduced/assertion_unassigned_range.ll
################################################################################
diff --git a/llvm/include/llvm/Transforms/IPO/Attributor.h b/llvm/include/llvm/Transforms/IPO/Attributor.h
index 9f012208ccd33..3b56653985aa5 100644
--- a/llvm/include/llvm/Transforms/IPO/Attributor.h
+++ b/llvm/include/llvm/Transforms/IPO/Attributor.h
@@ -128,7 +128,6 @@
#include "llvm/Support/TimeProfiler.h"
#include "llvm/Transforms/Utils/CallGraphUpdater.h"
-#include <limits>
#include <map>
#include <optional>
@@ -276,13 +275,11 @@ struct RangeTy {
}
/// Constants used to represent special offsets or sizes.
- /// - We cannot assume that Offsets and Size are non-negative.
+ /// - This assumes that Offset and Size are non-negative.
/// - The constants should not clash with DenseMapInfo, such as EmptyKey
/// (INT64_MAX) and TombstoneKey (INT64_MIN).
- /// We use values "in the middle" of the 64 bit range to represent these
- /// special cases.
- static constexpr int64_t Unassigned = std::numeric_limits<int32_t>::min();
- static constexpr int64_t Unknown = std::numeric_limits<int32_t>::max();
+ static constexpr int64_t Unassigned = -1;
+ static constexpr int64_t Unknown = -2;
};
inline raw_ostream &operator<<(raw_ostream &OS, const RangeTy &R) {
diff --git a/llvm/test/Transforms/Attributor/reduced/assertion_unassigned_range.ll b/llvm/test/Transforms/Attributor/reduced/assertion_unassigned_range.ll
deleted file mode 100644
index c7c5e7d8eb2ff..0000000000000
--- a/llvm/test/Transforms/Attributor/reduced/assertion_unassigned_range.ll
+++ /dev/null
@@ -1,25 +0,0 @@
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --scrub-attributes --check-attributes --check-globals
-; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=2 -S < %s | FileCheck %s --check-prefixes=CHECK,TUNIT
-; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC
-
-define i1 @_ZNK6openmc4Cell16contains_complexENS_8PositionES1_i() {
-; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn memory(none)
-; CHECK-LABEL: define {{[^@]+}}@_ZNK6openmc4Cell16contains_complexENS_8PositionES1_i
-; CHECK-SAME: () #[[ATTR0:[0-9]+]] {
-; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TOBOOL71:%.*]] = trunc i8 undef to i1
-; CHECK-NEXT: ret i1 false
-;
-entry:
- %stack = alloca [24 x i8], i32 0, align 1
- %arrayidx70 = getelementptr [24 x i8], ptr %stack, i64 0, i64 -1
- %0 = load i8, ptr %arrayidx70, align 1
- %tobool71 = trunc i8 %0 to i1
- ret i1 false
-}
-;.
-; CHECK: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind willreturn memory(none) }
-;.
-;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
-; CGSCC: {{.*}}
-; TUNIT: {{.*}}
More information about the llvm-commits
mailing list