Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
42a1a40
Upgrade SMACK to support LLVM 13
shaobo-he Mar 8, 2022
dc8f675
Upgrade Rust support to edition 2021
shaobo-he Mar 8, 2022
a2fef3f
Unified the conversion from APInt to std::string
shaobo-he Mar 8, 2022
7aa70b5
Restored sea-dsa link
shaobo-he Mar 10, 2022
1faf5f5
Preliminary changes needed to upgrade to LLVM 14
shaobo-he Mar 28, 2022
4e8ec19
Updated sea-dsa link
shaobo-he Mar 29, 2022
2452feb
Formatting
shaobo-he Mar 29, 2022
ddf88d3
bump sea-dsa version
shaobo-he Sep 11, 2023
a62cda8
fixed script formatting
shaobo-he Sep 16, 2023
6cf98e1
Merge origin/develop into llvm-14
shaobo-he Jul 4, 2026
613f182
Use latest Rust nightly for LLVM 14
shaobo-he Jul 4, 2026
08a6d0b
Merge pull request #814 from smackers/release-2.9.0
shaobo-he Jul 4, 2026
b7c58dd
Skip slow floppy2 regression under LLVM 14
shaobo-he Jul 4, 2026
6a94f77
Fix LLVM 14 build and reduce ntdrivers CI contention
shaobo-he Jul 4, 2026
a08afde
Restore floppy2 regression annotation spacing
shaobo-he Jul 4, 2026
76c74a9
Run late SROA before Boogie generation
shaobo-he Jul 4, 2026
85dc9b5
Update GitHub Actions versions
shaobo-he Jul 4, 2026
07fb13d
Promote allocas before pointer-int rewriting
shaobo-he Jul 4, 2026
e7ab807
Merge pull request #816 from smackers/update-actions-node24
shaobo-he Jul 4, 2026
42e61e5
Use upstream sea-dsa submodule URL
shaobo-he Jul 5, 2026
25fb5d4
Update sea-dsa to upstream dev14
shaobo-he Jul 5, 2026
27a58aa
Merge pull request #815 from smackers/llvm-14
shaobo-he Jul 5, 2026
5343942
Add Ubuntu 24.04 (noble) support
shaobo-he Jul 5, 2026
43cf314
Wrap --check comment to satisfy flake8 line length
shaobo-he Jul 5, 2026
4343d7f
Merge pull request #817 from smackers/ubuntu-24.04
shaobo-he Jul 5, 2026
412a996
Fix MergeGEP for LLVM 14
shaobo-he Jul 6, 2026
214776e
Merge pull request #819 from smackers/fix-llvm14-mergegep
shaobo-he Jul 6, 2026
39a1557
Handle constrained FP intrinsics conservatively
shaobo-he Jul 6, 2026
c6be0bf
Handle LLVM copysign intrinsic
shaobo-he Jul 6, 2026
091a8bb
Fix README CI badge endpoints
shaobo-he Jul 6, 2026
f0ff970
Merge pull request #821 from smackers/fix-795-constrained-intrinsics
shaobo-he Jul 6, 2026
a841e43
Merge pull request #822 from smackers/fix-readme-ci-badges
shaobo-he Jul 6, 2026
70aef60
Include assert.h in rise4fun examples
shaobo-he Jul 6, 2026
7244bb7
Merge pull request #820 from smackers/fix-801-copysign-intrinsic
shaobo-he Jul 6, 2026
8c66972
Merge pull request #823 from smackers/fix-769-rise4fun-assert
shaobo-he Jul 6, 2026
f6d659d
Make NormalizeLoops a loop pass
shaobo-he Jul 6, 2026
9d59cdb
Merge pull request #824 from smackers/fix-605-normalize-loops
shaobo-he Jul 6, 2026
d2e7acd
Move rounding mode initialization to fenv model
shaobo-he Jul 6, 2026
1c6f58a
Merge pull request #827 from smackers/fix-621-fenv-rmode-init
shaobo-he Jul 6, 2026
59f7b03
Fix vector bitwise and comparison translation
shaobo-he Jul 6, 2026
c9b0a8a
Merge pull request #826 from smackers/fix-736-vector-compare
shaobo-he Jul 6, 2026
391c254
Avoid redundant split aggregate memory checks
shaobo-he Jul 6, 2026
b66bab2
Merge pull request #829 from smackers/fix-710-split-aggregate-memory-…
shaobo-he Jul 7, 2026
afe5809
Bumped version number to 2.10.0
shaobo-he Jul 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/smack-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [push, pull_request]

jobs:
check-regressions:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
matrix:
regtest_env:
Expand Down Expand Up @@ -41,7 +41,7 @@ jobs:
"--exhaustive --folder=llvm --languages=llvm-ir"
]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v7

- name: install dependencies
env:
Expand All @@ -59,22 +59,22 @@ jobs:
run: ./bin/build.sh

build-and-push-docker:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
needs: check-regressions

steps:
- name: Check Out Repo
uses: actions/checkout@v2
uses: actions/checkout@v7

- name: Login to Docker Hub
uses: docker/login-action@v1
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v4

# borrowed from:
# https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions/58035262
Expand All @@ -94,7 +94,7 @@ jobs:
- name: Build and push
if: ${{ steps.set_tag.outputs.docker_tag != 'none' }}
id: docker_build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v7
with:
context: ./
file: ./Dockerfile
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:22.04
FROM ubuntu:24.04
MAINTAINER Shaobo He <polarishehn@gmail.com>

ENV SMACKDIR /home/user/smack
Expand Down
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = smack
PROJECT_NUMBER = 2.9.0
PROJECT_NUMBER = 2.10.0
PROJECT_BRIEF = "A bounded software verifier."
PROJECT_LOGO =
OUTPUT_DIRECTORY = docs
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![main branch ci status](https://github.com/smackers/smack/workflows/SMACK%20CI/badge.svg?branch=main)](https://github.com/smackers/smack/actions)
[![develop branch ci status](https://github.com/smackers/smack/workflows/SMACK%20CI/badge.svg?branch=develop)](https://github.com/smackers/smack/actions)
[![main branch ci status](https://github.com/smackers/smack/actions/workflows/smack-ci.yaml/badge.svg?branch=main)](https://github.com/smackers/smack/actions)
[![develop branch ci status](https://github.com/smackers/smack/actions/workflows/smack-ci.yaml/badge.svg?branch=develop)](https://github.com/smackers/smack/actions)

<img src="docs/smack-logo.png" width=400 alt="SMACK Logo" align="right">

Expand Down Expand Up @@ -62,4 +62,3 @@ benchmarking of SMACK.
1. [Projects](docs/projects.md)
1. [Publications](docs/publications.md)
1. [People](docs/people.md)

25 changes: 20 additions & 5 deletions bin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ linux-opensuse*)
DEPENDENCIES+=" ncurses-devel"
;;

linux-@(ubuntu|neon)-@(16|18|20|22)*)
linux-@(ubuntu|neon)-@(16|18|20|22|24)*)
if [ ${INSTALL_LLVM} -eq 1 ] ; then
DEPENDENCIES+=" clang-${LLVM_SHORT_VERSION} llvm-${LLVM_SHORT_VERSION}-dev"
fi
Expand Down Expand Up @@ -248,7 +248,7 @@ if [ ${INSTALL_DEPENDENCIES} -eq 1 ] ; then
sudo zypper --non-interactive install ${DEPENDENCIES}
;;

linux-@(ubuntu|neon)-@(1[68]|20|22)*)
linux-@(ubuntu|neon)-@(1[68]|20|22|24)*)
RELEASE_VERSION=$(get-platform-trim "$(lsb_release -r)" | awk -F: '{print $2;}')
case "$RELEASE_VERSION" in
16*)
Expand All @@ -263,6 +263,9 @@ if [ ${INSTALL_DEPENDENCIES} -eq 1 ] ; then
22*)
UBUNTU_CODENAME="jammy"
;;
24*)
UBUNTU_CODENAME="noble"
;;
*)
puts "Release ${RELEASE_VERSION} for ${distro} not supported. Dependencies must be installed manually."
exit 1
Expand All @@ -274,13 +277,25 @@ if [ ${INSTALL_DEPENDENCIES} -eq 1 ] ; then
fi

# Adding LLVM repository
if [ ${INSTALL_LLVM} -eq 1 ] ; then
# Ubuntu 24.04 (noble) ships the pinned Clang/LLVM version in its own
# (universe) repositories, and apt.llvm.org has no llvm-toolchain-noble feed
# for it, so on 24.04 the LLVM packages are installed directly from the Ubuntu
# archive instead of adding an apt.llvm.org repository (which also avoids the
# removed apt-key on noble).
if [ ${INSTALL_LLVM} -eq 1 ] && [[ "$RELEASE_VERSION" != 24* ]] ; then
${WGET} -O - http://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/${UBUNTU_CODENAME}/ llvm-toolchain-${UBUNTU_CODENAME}-${LLVM_SHORT_VERSION} main"
fi

# Adding .NET repository (skip for 22.04+ as it provides .NET 6 natively)
if [[ "$RELEASE_VERSION" != 22* ]]; then
# Adding .NET repository for dotnet-sdk-6.0 (required by Boogie and Corral):
# - 20.04 and older: use Microsoft's package feed
# - 22.04: .NET 6 is available in the default Ubuntu repositories
# - 24.04: .NET 6 is neither in the Ubuntu archive nor Microsoft's feed
# (Microsoft stopped publishing to packages.microsoft.com for 24.04), so
# use Canonical's dotnet backports PPA
if [[ "$RELEASE_VERSION" == 24* ]]; then
sudo add-apt-repository -y ppa:dotnet/backports
elif [[ "$RELEASE_VERSION" != 22* ]]; then
${WGET} -q https://packages.microsoft.com/config/ubuntu/${RELEASE_VERSION}/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo DEBIAN_FRONTEND=noninteractive dpkg -i --force-confdef --force-confold packages-microsoft-prod.deb
rm -f packages-microsoft-prod.deb
Expand Down
6 changes: 3 additions & 3 deletions bin/versions
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ BOOGIE_VERSION="2.15.7"
CORRAL_VERSION="1.1.8"
SYMBOOGLIX_COMMIT="ccb2e7f2b3"
LOCKPWN_COMMIT="12ba58f1ec"
LLVM_SHORT_VERSION="13"
LLVM_FULL_VERSION="13.0.1"
RUST_VERSION="nightly-2022-01-01"
LLVM_SHORT_VERSION="14"
LLVM_FULL_VERSION="14.0.0"
RUST_VERSION="nightly-2022-08-12"
1 change: 1 addition & 0 deletions examples/rise4fun/rise_simple.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "smack.h"
#include <assert.h>

int main(void) {
int x, y, z;
Expand Down
1 change: 1 addition & 0 deletions examples/rise4fun/rise_simple_buggy.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "smack.h"
#include <assert.h>

int main(void) {
int x, y, z;
Expand Down
1 change: 1 addition & 0 deletions include/smack/MemorySafetyChecker.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class MemorySafetyChecker : public llvm::FunctionPass,
void insertMemoryLeakCheck(llvm::Instruction *I);
void insertMemoryAccessCheck(llvm::Value *addr, llvm::Value *size,
llvm::Instruction *I);
bool visitSplitAggregateAccess(llvm::Value *addr, llvm::Instruction *I);

public:
static char ID; // Pass identification, replacement for typeid
Expand Down
8 changes: 4 additions & 4 deletions include/smack/NormalizeLoops.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
#ifndef NORMALIZELOOPS_H
#define NORMALIZELOOPS_H

#include "llvm/Analysis/LoopPass.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Module.h"
#include "llvm/Pass.h"
#include <map>

namespace smack {

class NormalizeLoops : public llvm::ModulePass {
class NormalizeLoops : public llvm::LoopPass {
public:
static char ID; // Pass identification, replacement for typeid
NormalizeLoops() : llvm::ModulePass(ID) {}
NormalizeLoops() : llvm::LoopPass(ID) {}
virtual llvm::StringRef getPassName() const override;
virtual bool runOnModule(llvm::Module &m) override;
virtual bool runOnLoop(llvm::Loop *L, llvm::LPPassManager &LPM) override;
virtual void getAnalysisUsage(llvm::AnalysisUsage &) const override;
};
} // namespace smack
Expand Down
1 change: 1 addition & 0 deletions include/smack/SmackInstGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include "llvm/Analysis/LoopInfo.h"
#include "llvm/IR/InstVisitor.h"
#include <map>
#include <set>
#include <unordered_set>

Expand Down
1 change: 1 addition & 0 deletions include/smack/SmackRep.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "llvm/Support/GraphWriter.h"
#include "llvm/Support/Regex.h"
#include <list>
#include <map>
#include <sstream>

namespace smack {
Expand Down
11 changes: 9 additions & 2 deletions include/smack/SplitAggregateValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@

namespace smack {

namespace SplitAggregateValueMetadata {
extern const char MemoryAccess[];
extern const char WholeMemoryAccess[];
} // namespace SplitAggregateValueMetadata

class SplitAggregateValue : public llvm::FunctionPass {
public:
typedef std::vector<std::pair<llvm::Value *, unsigned>> IndexT;
Expand All @@ -25,9 +30,11 @@ class SplitAggregateValue : public llvm::FunctionPass {
private:
llvm::Value *splitAggregateLoad(llvm::Type *T, llvm::Value *P,
std::vector<InfoT> &info,
llvm::IRBuilder<> &irb);
llvm::IRBuilder<> &irb,
bool preserveWholeAccessCheck);
void splitAggregateStore(llvm::Value *P, llvm::Value *V,
std::vector<InfoT> &info, llvm::IRBuilder<> &irb);
std::vector<InfoT> &info, llvm::IRBuilder<> &irb,
bool preserveWholeAccessCheck);
void splitConstantReturn(llvm::ReturnInst *ri, std::vector<InfoT> &info);
void splitConstantArg(llvm::CallInst *ci, unsigned i,
std::vector<InfoT> &info);
Expand Down
2 changes: 1 addition & 1 deletion include/utils/Devirt.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

#include "seadsa/CompleteCallGraph.hh"

#include <map>
#include <set>

using namespace llvm;
Expand Down Expand Up @@ -79,4 +80,3 @@ namespace llvm {
}
};
}

8 changes: 5 additions & 3 deletions lib/smack/AddTiming.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,14 @@ InstructionCost AddTiming::getInstructionCost(const Instruction *I) const {
case Instruction::Select: {
const SelectInst *SI = cast<SelectInst>(I);
Type *CondTy = SI->getCondition()->getType();
return TTI->getCmpSelInstrCost(I->getOpcode(), I->getType(), CondTy);
return TTI->getCmpSelInstrCost(I->getOpcode(), I->getType(), CondTy,
CmpInst::BAD_ICMP_PREDICATE);
}
case Instruction::ICmp:
case Instruction::FCmp: {
Type *ValTy = I->getOperand(0)->getType();
return TTI->getCmpSelInstrCost(I->getOpcode(), ValTy);
return TTI->getCmpSelInstrCost(I->getOpcode(), ValTy, nullptr,
CmpInst::BAD_ICMP_PREDICATE);
}
case Instruction::Store: {
const StoreInst *SI = cast<StoreInst>(I);
Expand Down Expand Up @@ -224,7 +226,7 @@ InstructionCost AddTiming::getInstructionCost(const Instruction *I) const {
case Instruction::Call: {
if (const IntrinsicInst *II = dyn_cast<IntrinsicInst>(I)) {
SmallVector<Type *, 4> Tys;
for (unsigned J = 0, JE = II->getNumArgOperands(); J != JE; ++J)
for (unsigned J = 0, JE = II->arg_size(); J != JE; ++J)
Tys.push_back(II->getArgOperand(J)->getType());

FastMathFlags FMF;
Expand Down
3 changes: 2 additions & 1 deletion lib/smack/AnnotateLoopExits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
// to reach the loop exit.
//

#define DEBUG_TYPE "smack-loop-unroll"
#include "smack/AnnotateLoopExits.h"
#include "smack/Debug.h"
#include "smack/Naming.h"
Expand All @@ -27,6 +26,8 @@

#include "llvm/Support/raw_ostream.h"

#define DEBUG_TYPE "smack-loop-unroll"

namespace smack {

using namespace llvm;
Expand Down
5 changes: 4 additions & 1 deletion lib/smack/CodifyStaticInits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ bool CodifyStaticInits::runOnModule(Module &M) {
if (V->getType()->isIntegerTy() || V->getType()->isPointerTy() ||
V->getType()->isFloatingPointTy() || V->getType()->isVectorTy())

IRB.CreateStore(V, IRB.CreateGEP(P, ArrayRef<Value *>(I)));
IRB.CreateStore(
V,
IRB.CreateGEP(P->getType()->getScalarType()->getPointerElementType(),
P, ArrayRef<Value *>(I)));

else if (ArrayType *AT = dyn_cast<ArrayType>(V->getType()))
for (unsigned i = AT->getNumElements(); i-- > 0;) {
Expand Down
8 changes: 4 additions & 4 deletions lib/smack/ExtractContracts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// This file is distributed under the MIT License. See LICENSE for details.
//

#define DEBUG_TYPE "contracts"

#include "smack/ExtractContracts.h"
#include "smack/Debug.h"
#include "smack/Naming.h"
Expand All @@ -15,6 +13,8 @@
#include "llvm/Transforms/Utils/Cloning.h"
#include "llvm/Transforms/Utils/CodeExtractor.h"

#define DEBUG_TYPE "contracts"

#include <map>
#include <set>
#include <stack>
Expand Down Expand Up @@ -247,7 +247,7 @@ bool ExtractContracts::runOnModule(Module &M) {
// function
for (auto Fs : getContractExprs(*newF)) {
std::vector<Value *> Args;
for (auto &A : I->arg_operands())
for (auto &A : I->args())
Args.push_back(A);
auto *E = Builder.CreateCall(std::get<1>(Fs), Args);
Builder.CreateCall(std::get<0>(Fs), {E});
Expand Down Expand Up @@ -276,7 +276,7 @@ bool ExtractContracts::runOnModule(Module &M) {
// insert one invariant invocation per invocation in the original loop
for (auto Fs : getContractExprs(*newF)) {
std::vector<Value *> Args;
for (auto &A : I->arg_operands())
for (auto &A : I->args())
Args.push_back(A);
auto *E = Builder.CreateCall(std::get<1>(Fs), Args);
Builder.CreateCall(std::get<0>(Fs), {E});
Expand Down
Loading
Loading