From a9dc65210131cef87b06095fd8b830ec2848d9d5a6962c283715d0aae15b5169 Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Fri, 28 May 2021 06:01:47 +0000 Subject: [PATCH] update patches OBS-URL: https://build.opensuse.org/package/show/devel:tools:statica/klee?expand=0&rev=102 --- ...e-getNumElements-has-been-deprecated.patch | 49 +++++ 0001-test-disable-until-it-is-fixed.patch | 23 --- ...> 0002-llvm12-Add-LLVM-12-to-lit.cfg.patch | 21 +- ...plement-llvm.-s-u-max-min-intrinsics.patch | 130 +++++++++++++ ...m11-Handle-llvm.roundeven-instrinsic.patch | 31 +++ ...-llvm12-Implement-llvm.abs-intrinsic.patch | 181 ++++++++++++++++++ klee.changes | 13 ++ klee.spec | 9 +- 8 files changed, 423 insertions(+), 34 deletions(-) create mode 100644 0001-llvm12-VectorType-getNumElements-has-been-deprecated.patch delete mode 100644 0001-test-disable-until-it-is-fixed.patch rename 0001-test-lit-add-12-to-supported-LLVM-versions.patch => 0002-llvm12-Add-LLVM-12-to-lit.cfg.patch (52%) create mode 100644 0005-llvm12-Implement-llvm.-s-u-max-min-intrinsics.patch create mode 100644 0006-llvm11-Handle-llvm.roundeven-instrinsic.patch create mode 100644 0007-llvm12-Implement-llvm.abs-intrinsic.patch diff --git a/0001-llvm12-VectorType-getNumElements-has-been-deprecated.patch b/0001-llvm12-VectorType-getNumElements-has-been-deprecated.patch new file mode 100644 index 0000000..883a5d3 --- /dev/null +++ b/0001-llvm12-VectorType-getNumElements-has-been-deprecated.patch @@ -0,0 +1,49 @@ +From: Lukas Zaoral +Date: Thu, 4 Mar 2021 15:02:57 +0100 +Subject: llvm12: VectorType::getNumElements() has been deprecated +Git-repo: https://github.com/lzaoral/klee.git +Git-commit: 74ea9e5e63c5933ca2d5d7f846858c4de6e86b81 +Patch-mainline: pr#1389 +References: LLVM 12 + +... and has already been removed from the LLVM 13 source tree. + +See: +https://reviews.llvm.org/D78127 +https://reviews.llvm.org/D95570 +Signed-off-by: Jiri Slaby +--- + lib/Core/Executor.cpp | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp +index a81c4882..aaa56a55 100644 +--- a/lib/Core/Executor.cpp ++++ b/lib/Core/Executor.cpp +@@ -3137,7 +3137,11 @@ void Executor::executeInstruction(ExecutionState &state, KInstruction *ki) { + return; + } + uint64_t iIdx = cIdx->getZExtValue(); ++#if LLVM_VERSION_MAJOR >= 11 ++ const auto *vt = cast(iei->getType()); ++#else + const llvm::VectorType *vt = iei->getType(); ++#endif + unsigned EltBits = getWidthForLLVMType(vt->getElementType()); + + if (iIdx >= vt->getNumElements()) { +@@ -3175,7 +3179,11 @@ void Executor::executeInstruction(ExecutionState &state, KInstruction *ki) { + return; + } + uint64_t iIdx = cIdx->getZExtValue(); ++#if LLVM_VERSION_MAJOR >= 11 ++ const auto *vt = cast(eei->getVectorOperandType()); ++#else + const llvm::VectorType *vt = eei->getVectorOperandType(); ++#endif + unsigned EltBits = getWidthForLLVMType(vt->getElementType()); + + if (iIdx >= vt->getNumElements()) { +-- +2.26.2 + diff --git a/0001-test-disable-until-it-is-fixed.patch b/0001-test-disable-until-it-is-fixed.patch deleted file mode 100644 index 1b26463..0000000 --- a/0001-test-disable-until-it-is-fixed.patch +++ /dev/null @@ -1,23 +0,0 @@ -From: Jiri Slaby -Date: Thu, 20 May 2021 12:16:09 +0200 -Subject: test: disable until it is fixed -Patch-mainline: no -References: LLVM 12 - -Signed-off-by: Jiri Slaby ---- - .../Uclibc/2007-10-08-optimization-calls-wrong-libc-functions.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/test/Runtime/Uclibc/2007-10-08-optimization-calls-wrong-libc-functions.c b/test/Runtime/Uclibc/2007-10-08-optimization-calls-wrong-libc-functions.c -index 95b94e41..c274b214 100644 ---- a/test/Runtime/Uclibc/2007-10-08-optimization-calls-wrong-libc-functions.c -+++ b/test/Runtime/Uclibc/2007-10-08-optimization-calls-wrong-libc-functions.c -@@ -1,3 +1,4 @@ -+// REQUIRES: lt-llvm-12.0 - // RUN: %clang %s -emit-llvm %O0opt -c -o %t1.bc - // RUN: rm -rf %t.klee-out - // RUN: %klee --output-dir=%t.klee-out --exit-on-error --optimize --libc=uclibc %t1.bc --- -2.26.2 - diff --git a/0001-test-lit-add-12-to-supported-LLVM-versions.patch b/0002-llvm12-Add-LLVM-12-to-lit.cfg.patch similarity index 52% rename from 0001-test-lit-add-12-to-supported-LLVM-versions.patch rename to 0002-llvm12-Add-LLVM-12-to-lit.cfg.patch index b7190d5..310f58d 100644 --- a/0001-test-lit-add-12-to-supported-LLVM-versions.patch +++ b/0002-llvm12-Add-LLVM-12-to-lit.cfg.patch @@ -1,24 +1,27 @@ -From: Jiri Slaby -Date: Thu, 20 May 2021 12:03:08 +0200 -Subject: test/lit: add 12 to supported LLVM versions -Patch-mainline: no +From: Lukas Zaoral +Date: Thu, 4 Mar 2021 15:12:03 +0100 +Subject: llvm12: Add LLVM 12 to lit.cfg +Git-repo: https://github.com/lzaoral/klee.git +Git-commit: af84c2c765dd748083dada51f9182d7648eb974b +Patch-mainline: pr#1389 References: LLVM 12 Signed-off-by: Jiri Slaby --- - test/lit.cfg | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) + test/lit.cfg | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/lit.cfg b/test/lit.cfg -index a195a1dc..1a119f9e 100644 +index a195a1dc..c79c44a5 100644 --- a/test/lit.cfg +++ b/test/lit.cfg -@@ -157,7 +157,7 @@ config.substitutions.append( +@@ -157,7 +157,8 @@ config.substitutions.append( # Add feature for the LLVM version in use, so it can be tested in REQUIRES and # XFAIL checks. We also add "not-XXX" variants, for the same reason. -known_llvm_versions = set(["3.8", "3.9", "4.0", "5.0", "6.0", "7.0", "7.1", "8.0", "9.0", "10.0", "11.0", "11.1"]) -+known_llvm_versions = set(["3.8", "3.9", "4.0", "5.0", "6.0", "7.0", "7.1", "8.0", "9.0", "10.0", "11.0", "11.1", "12.0"]) ++known_llvm_versions = { "3.8", "3.9", "4.0", "5.0", "6.0", "7.0", "7.1", "8.0", ++ "9.0", "10.0", "11.0", "11.1", "12.0" } current_llvm_version_tuple = (int(config.llvm_version_major), int(config.llvm_version_minor)) current_llvm_version = "%s.%s" % current_llvm_version_tuple diff --git a/0005-llvm12-Implement-llvm.-s-u-max-min-intrinsics.patch b/0005-llvm12-Implement-llvm.-s-u-max-min-intrinsics.patch new file mode 100644 index 0000000..52fecde --- /dev/null +++ b/0005-llvm12-Implement-llvm.-s-u-max-min-intrinsics.patch @@ -0,0 +1,130 @@ +From: Lukas Zaoral +Date: Thu, 27 May 2021 21:20:58 +0200 +Subject: llvm12: Implement llvm.{s,u}{max,min} intrinsics +Git-repo: https://github.com/lzaoral/klee.git +Git-commit: a34fb8961649bf3a065ec8f0eb4bc58715fd1d57 +Patch-mainline: pr#1389 +References: LLVM 12 + +The vector variants are not implemented at the moment. + +See: https://reviews.llvm.org/D84125 +Signed-off-by: Jiri Slaby +--- + lib/Module/IntrinsicCleaner.cpp | 35 ++++++++++++++++++++ + test/Intrinsics/MinMax.ll | 57 +++++++++++++++++++++++++++++++++ + 2 files changed, 92 insertions(+) + create mode 100644 test/Intrinsics/MinMax.ll + +diff --git a/lib/Module/IntrinsicCleaner.cpp b/lib/Module/IntrinsicCleaner.cpp +index eaec7722..a4bb4ee8 100644 +--- a/lib/Module/IntrinsicCleaner.cpp ++++ b/lib/Module/IntrinsicCleaner.cpp +@@ -345,6 +345,41 @@ bool IntrinsicCleanerPass::runOnBasicBlock(BasicBlock &b, Module &M) { + } + #endif + ++#if LLVM_VERSION_CODE >= LLVM_VERSION(12, 0) ++ case Intrinsic::smax: ++ case Intrinsic::smin: ++ case Intrinsic::umax: ++ case Intrinsic::umin: { ++ IRBuilder<> builder(ii); ++ assert(ii->getNumArgOperands() == 2 && "wrong number of arguments"); ++ ++ Value *op1 = ii->getArgOperand(0); ++ Value *op2 = ii->getArgOperand(1); ++ ++ assert(op1->getType() == op2->getType() && "operand type mismatch"); ++ ++ // TODO: vectors ++ assert(!isa(op1->getType()) && ++ "llvm.{s,u}{max,min} with vectors is not supported"); ++ ++ Value *condition = nullptr; ++ if (ii->getIntrinsicID() == Intrinsic::smax) ++ condition = builder.CreateICmpSGT(op1, op2); ++ else if (ii->getIntrinsicID() == Intrinsic::smin) ++ condition = builder.CreateICmpSLT(op1, op2); ++ else if (ii->getIntrinsicID() == Intrinsic::umax) ++ condition = builder.CreateICmpUGT(op1, op2); ++ else // (ii->getIntrinsicID() == Intrinsic::umin) ++ condition = builder.CreateICmpULT(op1, op2); ++ ++ Value *result = builder.CreateSelect(condition, op1, op2); ++ ii->replaceAllUsesWith(result); ++ ii->eraseFromParent(); ++ dirty = true; ++ break; ++ } ++#endif ++ + // The following intrinsics are currently handled by LowerIntrinsicCall + // (Invoking LowerIntrinsicCall with any intrinsics not on this + // list throws an exception.) +diff --git a/test/Intrinsics/MinMax.ll b/test/Intrinsics/MinMax.ll +new file mode 100644 +index 00000000..429fb1f2 +--- /dev/null ++++ b/test/Intrinsics/MinMax.ll +@@ -0,0 +1,57 @@ ++; REQUIRES: geq-llvm-12.0 ++; RUN: %llvmas %s -o=%t.bc ++; RUN: rm -rf %t.klee-out ++; RUN: %klee -exit-on-error --output-dir=%t.klee-out --optimize=false %t.bc | \ ++; RUN: FileCheck %s ++; ModuleID = 'MinMax.ll' ++source_filename = "MinMax.c" ++target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" ++target triple = "x86_64-unknown-linux-gnu" ++ ++@0 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ++@1 = private unnamed_addr constant [4 x i8] c"%u\0A\00", align 1 ++ ++; Function Attrs: nofree nounwind uwtable ++define dso_local i32 @main() local_unnamed_addr #0 { ++ ; smax ++ %1 = call i32 @llvm.smax.i32(i32 -10, i32 10) ++ %2 = call i32 (i8*, ...) @printf(i8* nonnull dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @0, i64 0, i64 0), i32 %1) ++ ; CHECK: 10 ++ ; smin ++ %3 = call i32 @llvm.smin.i32(i32 -10, i32 %2) ++ %4 = call i32 (i8*, ...) @printf(i8* nonnull dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @0, i64 0, i64 0), i32 %3) ++ ; CHECK: -10 ++ ; smin ++ %5 = call i32 @llvm.umax.i32(i32 %2, i32 20) ++ %6 = call i32 (i8*, ...) @printf(i8* nonnull dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @1, i64 0, i64 0), i32 %5) ++ ; CHECK: 20 ++ ; smin ++ %7 = call i32 @llvm.umin.i32(i32 10, i32 %5) ++ %8 = call i32 (i8*, ...) @printf(i8* nonnull dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @1, i64 0, i64 0), i32 %7) ++ ; CHECK: 10 ++ ret i32 0 ++} ++ ++; Function Attrs: nofree nounwind ++declare dso_local noundef i32 @printf(i8* nocapture noundef readonly, ...) local_unnamed_addr #1 ++ ++; Function Attrs: nofree nosync nounwind readnone speculatable willreturn ++declare i32 @llvm.smax.i32(i32, i32) #2 ++ ++; Function Attrs: nofree nosync nounwind readnone speculatable willreturn ++declare i32 @llvm.smin.i32(i32, i32) #2 ++ ++; Function Attrs: nofree nosync nounwind readnone speculatable willreturn ++declare i32 @llvm.umax.i32(i32, i32) #2 ++ ++; Function Attrs: nofree nosync nounwind readnone speculatable willreturn ++declare i32 @llvm.umin.i32(i32, i32) #2 ++ ++attributes #0 = { nofree nounwind uwtable "disable-tail-calls"="false" "frame-pointer"="none" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" } ++attributes #1 = { nofree nounwind "disable-tail-calls"="false" "frame-pointer"="none" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" } ++attributes #2 = { nofree nosync nounwind readnone speculatable willreturn } ++ ++!0 = !{!1, !1, i64 0} ++!1 = !{!"int", !2, i64 0} ++!2 = !{!"omnipotent char", !3, i64 0} ++!3 = !{!"Simple C/C++ TBAA"} +-- +2.26.2 + diff --git a/0006-llvm11-Handle-llvm.roundeven-instrinsic.patch b/0006-llvm11-Handle-llvm.roundeven-instrinsic.patch new file mode 100644 index 0000000..6ea4a17 --- /dev/null +++ b/0006-llvm11-Handle-llvm.roundeven-instrinsic.patch @@ -0,0 +1,31 @@ +From: Lukas Zaoral +Date: Thu, 27 May 2021 21:25:00 +0200 +Subject: llvm11: Handle llvm.roundeven instrinsic +Git-repo: https://github.com/lzaoral/klee.git +Git-commit: 2b29d86a39421ac76421b888b96613173bc18851 +Patch-mainline: pr#1389 +References: LLVM 12 + +See: https://reviews.llvm.org/D75670 +Signed-off-by: Jiri Slaby +--- + lib/Module/IntrinsicCleaner.cpp | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/lib/Module/IntrinsicCleaner.cpp b/lib/Module/IntrinsicCleaner.cpp +index a4bb4ee8..0851d8b5 100644 +--- a/lib/Module/IntrinsicCleaner.cpp ++++ b/lib/Module/IntrinsicCleaner.cpp +@@ -427,6 +427,9 @@ bool IntrinsicCleanerPass::runOnBasicBlock(BasicBlock &b, Module &M) { + case Intrinsic::readcyclecounter: + case Intrinsic::returnaddress: + case Intrinsic::round: ++#if LLVM_VERSION_CODE >= LLVM_VERSION(11, 0) ++ case Intrinsic::roundeven: ++#endif + case Intrinsic::sin: + case Intrinsic::sqrt: + case Intrinsic::stackrestore: +-- +2.26.2 + diff --git a/0007-llvm12-Implement-llvm.abs-intrinsic.patch b/0007-llvm12-Implement-llvm.abs-intrinsic.patch new file mode 100644 index 0000000..84a619b --- /dev/null +++ b/0007-llvm12-Implement-llvm.abs-intrinsic.patch @@ -0,0 +1,181 @@ +From: Lukas Zaoral +Date: Thu, 27 May 2021 21:48:02 +0200 +Subject: llvm12: Implement llvm.abs intrinsic +Git-repo: https://github.com/lzaoral/klee.git +Git-commit: c0b10c6f7a00d81cfce24115168dd06888685f87 +Patch-mainline: pr#1389 +References: LLVM 12 + +The vector and poisonous variants are not implemented at the moment. + +See: https://reviews.llvm.org/D84125 +Signed-off-by: Jiri Slaby +--- + lib/Module/IntrinsicCleaner.cpp | 41 ++++++++++++ + test/Intrinsics/abs-no-overflow.ll | 102 +++++++++++++++++++++++++++++ + 2 files changed, 143 insertions(+) + create mode 100644 test/Intrinsics/abs-no-overflow.ll + +diff --git a/lib/Module/IntrinsicCleaner.cpp b/lib/Module/IntrinsicCleaner.cpp +index 0851d8b5..d8fab623 100644 +--- a/lib/Module/IntrinsicCleaner.cpp ++++ b/lib/Module/IntrinsicCleaner.cpp +@@ -346,6 +346,47 @@ bool IntrinsicCleanerPass::runOnBasicBlock(BasicBlock &b, Module &M) { + #endif + + #if LLVM_VERSION_CODE >= LLVM_VERSION(12, 0) ++ case Intrinsic::abs: { ++ assert(ii->getNumArgOperands() == 2 && "wrong number of arguments"); ++ ++ Value *op = ii->getArgOperand(0); ++ ConstantInt *isIntMinPoison = ++ dyn_cast_or_null(ii->getArgOperand(1)); ++ ++ assert(isIntMinPoison && ++ "Failed to get second argument or it is not ConstantInt"); ++ assert(isIntMinPoison->getBitWidth() == 1 && ++ "Second argument is not an i1"); ++ ++ // TODO: vectors ++ unsigned bw = op->getType()->getPrimitiveSizeInBits(); ++ assert(!isa(op->getType()) && ++ "llvm.abs with vectors is not supported"); ++ ++ // TODO: support isIntMinPoison ++ // if (isIntMinPoison->isOne()) ++ ++ ConstantInt *zero = ConstantInt::get(ctx, APInt(bw, 0)); ++ ConstantInt *mone = ConstantInt::get(ctx, APInt(bw, -1)); ++ ConstantInt *smin = ConstantInt::get(ctx, APInt::getSignedMinValue(bw)); ++ ++ IRBuilder<> builder(ii); ++ ++ // conditions to flip the sign -- INT_MIN < op < 0 ++ Value *negative = builder.CreateICmpSLT(op, zero); ++ Value *notsmin = builder.CreateICmpNE(op, smin); ++ Value *condition = builder.CreateAnd(negative, notsmin); ++ ++ // flip and select the result ++ Value *flipped = builder.CreateMul(op, mone); ++ Value *result = builder.CreateSelect(condition, flipped, op); ++ ++ ii->replaceAllUsesWith(result); ++ ii->eraseFromParent(); ++ dirty = true; ++ break; ++ } ++ + case Intrinsic::smax: + case Intrinsic::smin: + case Intrinsic::umax: +diff --git a/test/Intrinsics/abs-no-overflow.ll b/test/Intrinsics/abs-no-overflow.ll +new file mode 100644 +index 00000000..fad95412 +--- /dev/null ++++ b/test/Intrinsics/abs-no-overflow.ll +@@ -0,0 +1,102 @@ ++; LLVM has an intrinsic for abs. ++; This file is based on the following code with the modification to ++; poisoning of llvm.abs. ++; ``` ++; #include "klee/klee.h" ++; ++; #include ++; #include ++; ++; volatile int abs_a; ++; ++; int main(void) ++; { ++; int a; ++; klee_make_symbolic(&a, sizeof(a), "a"); ++; ++; abs_a = a < 0 ? -a : a; ++; if (abs_a == INT_MIN) ++; assert(abs_a == a); ++; else ++; assert(abs_a >= 0); ++; return abs_a; ++; } ++; ``` ++; REQUIRES: geq-llvm-12.0 ++; RUN: %llvmas %s -o=%t.bc ++; RUN: rm -rf %t.klee-out ++; RUN: %klee -exit-on-error --output-dir=%t.klee-out --optimize=false %t.bc ++; ModuleID = 'abs-no-overflow.ll' ++source_filename = "abs-no-overflow.c" ++target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" ++target triple = "x86_64-unknown-linux-gnu" ++ ++@0 = private unnamed_addr constant [2 x i8] c"a\00", align 1 ++@abs_a = dso_local global i32 0, align 4 ++@1 = private unnamed_addr constant [11 x i8] c"abs_a == a\00", align 1 ++@2 = private unnamed_addr constant [7 x i8] c"test.c\00", align 1 ++@3 = private unnamed_addr constant [15 x i8] c"int main(void)\00", align 1 ++@4 = private unnamed_addr constant [11 x i8] c"abs_a >= 0\00", align 1 ++ ++; Function Attrs: nounwind uwtable ++define dso_local i32 @main() local_unnamed_addr #0 { ++ %1 = alloca i32, align 4 ++ %2 = bitcast i32* %1 to i8* ++ call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %2) #5 ++ call void @klee_make_symbolic(i8* nonnull %2, i64 4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i64 0, i64 0)) #5 ++ %3 = load i32, i32* %1, align 4, !tbaa !0 ++ %4 = call i32 @llvm.abs.i32(i32 %3, i1 false) ++ store volatile i32 %4, i32* @abs_a, align 4, !tbaa !0 ++ %5 = load volatile i32, i32* @abs_a, align 4, !tbaa !0 ++ %6 = icmp eq i32 %5, -2147483648 ++ %7 = load volatile i32, i32* @abs_a, align 4, !tbaa !0 ++ br i1 %6, label %8, label %11 ++ ++8: ; preds = %0 ++ %9 = icmp eq i32 %7, %3 ++ br i1 %9, label %14, label %10 ++ ++10: ; preds = %8 ++ call void @__assert_fail(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @2, i64 0, i64 0), i32 15, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @3, i64 0, i64 0)) #6 ++ unreachable ++ ++11: ; preds = %0 ++ %12 = icmp sgt i32 %7, -1 ++ br i1 %12, label %14, label %13 ++ ++13: ; preds = %11 ++ call void @__assert_fail(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @4, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @2, i64 0, i64 0), i32 17, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @3, i64 0, i64 0)) #6 ++ unreachable ++ ++14: ; preds = %11, %8 ++ %15 = load volatile i32, i32* @abs_a, align 4, !tbaa !0 ++ call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %2) #5 ++ ret i32 %15 ++} ++ ++; Function Attrs: argmemonly nofree nosync nounwind willreturn ++declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #1 ++ ++declare dso_local void @klee_make_symbolic(i8*, i64, i8*) local_unnamed_addr #2 ++ ++; Function Attrs: noreturn nounwind ++declare dso_local void @__assert_fail(i8*, i8*, i32, i8*) local_unnamed_addr #3 ++ ++; Function Attrs: argmemonly nofree nosync nounwind willreturn ++declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #1 ++ ++; Function Attrs: nofree nosync nounwind readnone speculatable willreturn ++declare i32 @llvm.abs.i32(i32, i1 immarg) #4 ++ ++attributes #0 = { nounwind uwtable "disable-tail-calls"="false" "frame-pointer"="none" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" } ++attributes #1 = { argmemonly nofree nosync nounwind willreturn } ++attributes #2 = { "disable-tail-calls"="false" "frame-pointer"="none" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" } ++attributes #3 = { noreturn nounwind "disable-tail-calls"="false" "frame-pointer"="none" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" } ++attributes #4 = { nofree nosync nounwind readnone speculatable willreturn } ++attributes #5 = { nounwind } ++attributes #6 = { noreturn nounwind } ++ ++!0 = !{!1, !1, i64 0} ++!1 = !{!"int", !2, i64 0} ++!2 = !{!"omnipotent char", !3, i64 0} ++!3 = !{!"Simple C/C++ TBAA"} +-- +2.26.2 + diff --git a/klee.changes b/klee.changes index 892e2c2..0e7a05d 100644 --- a/klee.changes +++ b/klee.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Fri May 28 05:52:48 UTC 2021 - Jiri Slaby + +- remove (replaced by the below upstreamable patches) + * 0001-test-disable-until-it-is-fixed.patch + * 0001-test-lit-add-12-to-supported-LLVM-versions.patch +- add (patches from pr#1389) + * 0001-llvm12-VectorType-getNumElements-has-been-deprecated.patch + * 0002-llvm12-Add-LLVM-12-to-lit.cfg.patch + * 0005-llvm12-Implement-llvm.-s-u-max-min-intrinsics.patch + * 0006-llvm11-Handle-llvm.roundeven-instrinsic.patch + * 0007-llvm12-Implement-llvm.abs-intrinsic.patch + ------------------------------------------------------------------- Thu May 20 06:05:58 UTC 2021 - jslaby@suse.cz diff --git a/klee.spec b/klee.spec index b0ce8f4..5b5913c 100644 --- a/klee.spec +++ b/klee.spec @@ -38,8 +38,13 @@ Source0: %{name}-%{version}.tar.xz Source1: %{name}-rpmlintrc Source2: https://raw.githubusercontent.com/llvm/llvm-project/llvmorg-%{llvm_version_major}.0.0/llvm/utils/not/not.cpp Source3: https://raw.githubusercontent.com/llvm/llvm-project/llvmorg-%{llvm_version_major}.0.0/llvm/utils/FileCheck/FileCheck.cpp -Patch0: 0001-test-lit-add-12-to-supported-LLVM-versions.patch -Patch1: 0001-test-disable-until-it-is-fixed.patch +Patch0: 0001-llvm12-VectorType-getNumElements-has-been-deprecated.patch +Patch1: 0002-llvm12-Add-LLVM-12-to-lit.cfg.patch +Patch2: 0002-test-disable-until-it-is-fixed.patch +Patch3: 0003-llvm12-Add-LLVM-12-to-Travis-CI-and-GitHub-Actions.patch +Patch4: 0005-llvm12-Implement-llvm.-s-u-max-min-intrinsics.patch +Patch5: 0006-llvm11-Handle-llvm.roundeven-instrinsic.patch +Patch6: 0007-llvm12-Implement-llvm.abs-intrinsic.patch BuildRequires: clang%{llvm_version} BuildRequires: cmake BuildRequires: gperftools-devel