-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Analysis] Exclude llvm.allow.{runtime,ubsan}.check() from AliasSetTracker #86065
Merged
vitalybuka
merged 6 commits into
main
from
users/vitalybuka/spr/analysis-exclude-llvmallowruntimeubsancheck-from-aliassettracker
Apr 1, 2024
Merged
[Analysis] Exclude llvm.allow.{runtime,ubsan}.check() from AliasSetTracker #86065
vitalybuka
merged 6 commits into
main
from
users/vitalybuka/spr/analysis-exclude-llvmallowruntimeubsancheck-from-aliassettracker
Apr 1, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Created using spr 1.3.4 [skip ci]
Created using spr 1.3.4
@llvm/pr-subscribers-llvm-globalisel @llvm/pr-subscribers-llvm-analysis Author: Vitaly Buka (vitalybuka) ChangesRFC: https://discourse.llvm.org/t/rfc-add-llvm-experimental-hot-intrinsic-or-llvm-hot/77641 Full diff: https://github.com/llvm/llvm-project/pull/86065.diff 2 Files Affected:
diff --git a/llvm/lib/Analysis/AliasSetTracker.cpp b/llvm/lib/Analysis/AliasSetTracker.cpp
index 59bb40cdba6e15..32e545daaf2269 100644
--- a/llvm/lib/Analysis/AliasSetTracker.cpp
+++ b/llvm/lib/Analysis/AliasSetTracker.cpp
@@ -354,6 +354,8 @@ void AliasSetTracker::addUnknown(Instruction *Inst) {
default:
break;
// FIXME: Add lifetime/invariant intrinsics (See: PR30807).
+ case Intrinsic::allow_runtime_check:
+ case Intrinsic::allow_ubsan_check:
case Intrinsic::assume:
case Intrinsic::experimental_noalias_scope_decl:
case Intrinsic::sideeffect:
diff --git a/llvm/test/Analysis/AliasSet/intrinsics.ll b/llvm/test/Analysis/AliasSet/intrinsics.ll
index 678d6d246e639c..0dc802ca7e0aaf 100644
--- a/llvm/test/Analysis/AliasSet/intrinsics.ll
+++ b/llvm/test/Analysis/AliasSet/intrinsics.ll
@@ -74,6 +74,36 @@ entry:
ret void
}
+; CHECK: Alias sets for function 'test_runtime':
+; CHECK: Alias Set Tracker: 2 alias sets for 2 pointer values.
+; CHECK: AliasSet[0x{{[0-9a-f]+}}, 1] must alias, Mod Memory locations: (ptr %a, LocationSize::precise(1))
+; CHECK: AliasSet[0x{{[0-9a-f]+}}, 1] must alias, Mod Memory locations: (ptr %b, LocationSize::precise(1))
+define i1 @test_runtime() local_unnamed_addr {
+entry:
+ %a = alloca i8, align 1
+ %b = alloca i8, align 1
+ store i8 1, ptr %a, align 1
+ %allow = call i1 @llvm.allow.runtime.check(metadata !"test_check")
+ store i8 1, ptr %b, align 1
+ ret i1 %allow
+}
+
+; CHECK: Alias sets for function 'test_ubsan':
+; CHECK: Alias Set Tracker: 2 alias sets for 2 pointer values.
+; CHECK: AliasSet[0x{{[0-9a-f]+}}, 1] must alias, Mod Memory locations: (ptr %a, LocationSize::precise(1))
+; CHECK: AliasSet[0x{{[0-9a-f]+}}, 1] must alias, Mod Memory locations: (ptr %b, LocationSize::precise(1))
+define i1 @test_ubsan() local_unnamed_addr {
+entry:
+ %a = alloca i8, align 1
+ %b = alloca i8, align 1
+ store i8 1, ptr %a, align 1
+ %allow = call i1 @llvm.allow.ubsan.check(i8 7)
+ store i8 1, ptr %b, align 1
+ ret i1 %allow
+}
+
+declare i1 @llvm.allow.ubsan.check(i8)
+declare i1 @llvm.allow.runtime.check(metadata)
declare void @llvm.assume(i1)
declare void @llvm.experimental.guard(i1, ...)
declare void @llvm.experimental.noalias.scope.decl(metadata)
|
aeubanks
approved these changes
Mar 26, 2024
vitalybuka
changed the base branch from
users/vitalybuka/spr/main.analysis-exclude-llvmallowruntimeubsancheck-from-aliassettracker
to
main
April 1, 2024 05:32
vitalybuka
changed the base branch from
main
to
users/vitalybuka/spr/main.analysis-exclude-llvmallowruntimeubsancheck-from-aliassettracker
April 1, 2024 05:37
Created using spr 1.3.4 [skip ci]
vitalybuka
changed the base branch from
users/vitalybuka/spr/main.analysis-exclude-llvmallowruntimeubsancheck-from-aliassettracker
to
main
April 1, 2024 05:43
vitalybuka
changed the base branch from
main
to
users/vitalybuka/spr/main.analysis-exclude-llvmallowruntimeubsancheck-from-aliassettracker
April 1, 2024 05:44
vitalybuka
changed the base branch from
users/vitalybuka/spr/main.analysis-exclude-llvmallowruntimeubsancheck-from-aliassettracker
to
main
April 1, 2024 05:47
vitalybuka
deleted the
users/vitalybuka/spr/analysis-exclude-llvmallowruntimeubsancheck-from-aliassettracker
branch
April 1, 2024 05:47
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
RFC: https://discourse.llvm.org/t/rfc-add-llvm-experimental-hot-intrinsic-or-llvm-hot/77641