Skip to content

Commit

Permalink
crucible-llvm: Skip llvm.experimental.noalias.scope.decl and llvm.dbg…
Browse files Browse the repository at this point in the history
….assign (#1205)

This adds `llvm.experimental.noalias.scope.decl` and `llvm.dbg.assign` to the
list of LLVM intrinsics that `crucible-llvm` skips over during simulation.
Doing so unlocks more support for recent LLVM versions.

It is conceivable that we may want to reason about these intrinsics at a deeper level some
day. If so, see:

* #1196 (comment) for
  how this would be done for `llvm.experimental.noalias.scope.decl`
* #1204 (comment) for how
  this would be done for `llvm.dbg.assign`

Fixes #1196. Fixes #1204.
  • Loading branch information
RyanGlScott committed May 24, 2024
1 parent f8fca6e commit 3ed848a
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1942,6 +1942,8 @@ callFunction defSet instr tailCall_ fnTy fn args assign_f
, "llvm.dbg.declare"
, "llvm.dbg.addr"
, "llvm.dbg.value"
, "llvm.dbg.assign" -- Added in LLVM 16
, "llvm.experimental.noalias.scope.decl" -- Added in LLVM 12
, "llvm.lifetime.start"
, "llvm.lifetime.start.p0"
, "llvm.lifetime.start.p0i8"
Expand Down
14 changes: 14 additions & 0 deletions crux-llvm/test-data/golden/T1196.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
void foo(int* restrict p0, int* restrict p1) {
*p0 = *p1;
}

__attribute__((noinline)) void test_inline_foo(int* p0, int* p1) {
foo(p0, p1);
}

int main(void) {
int p0 = 0;
int p1 = 1;
test_inline_foo(&p0, &p1);
return 0;
}
1 change: 1 addition & 0 deletions crux-llvm/test-data/golden/T1196.z3.good
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[Crux] Overall status: Valid.
8 changes: 8 additions & 0 deletions crux-llvm/test-data/golden/T1204.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
__attribute__((noinline)) int foo(int x[2]) {
return x[0];
}

int main(void) {
int x[2] = { 0, 0 };
return foo(x);
}
1 change: 1 addition & 0 deletions crux-llvm/test-data/golden/T1204.z3.good
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[Crux] Overall status: Valid.

0 comments on commit 3ed848a

Please sign in to comment.