Skip to content

Commit

Permalink
fix LLVM's !dereferenceable metadata semantics
Browse files Browse the repository at this point in the history
  • Loading branch information
nunoplopes committed Dec 14, 2023
1 parent 030007d commit 65e98d2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 20 deletions.
10 changes: 1 addition & 9 deletions llvm_util/llvm2alive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,6 @@ FpExceptionMode parse_exceptions(llvm::Instruction &i) {
}
}

Value* get_ptr(Instr &i) {
for (auto *op : i.operands()) {
if (op->getType().isPtrType())
return op;
}
UNREACHABLE();
}

bool hit_limits;
unsigned constexpr_idx;
unsigned copy_idx;
Expand Down Expand Up @@ -1297,7 +1289,7 @@ class llvm2alive_ : public llvm::InstVisitor<llvm2alive_, unique_ptr<Instr>> {
auto bytes = get_operand(
llvm::mdconst::extract<llvm::ConstantInt>(Node->getOperand(0)));
BB->addInstr(
make_unique<Assume>(vector<Value*>{get_ptr(*i), bytes}, kind));
make_unique<Assume>(vector<Value*>{i, bytes}, kind));
break;
}

Expand Down
11 changes: 0 additions & 11 deletions tests/alive-tv/memory/dereferenceable_metadata.srctgt.ll

This file was deleted.

0 comments on commit 65e98d2

Please sign in to comment.