Changelog for crucible-llvm-0.9
0.9 -- 2026-01-29
-
The
LLVM_Debugdata constructor forLLVMStmt, as well as the relatedLLVM_Dbgdata type, have been removed. -
Remove
aggInfoin favor ofaggregateAlignment, a lens that retrieves anAlignmentinstead of a fullAlignInfo. In practice,aggInfowould only ever contain a single size (0) in itsAlignInfo, and the concept of "size" doesn't really apply to aggregate alignments in data layout strings, so this was simplified to just be anAlignmentinstead. -
Support simulating bitcode that uses features from LLVM 19, including debug records and
getelementptrattributes. -
Support the
nnegflag inzextanduitofpinstructions. Ifnnegis set, then converting a negative argument will yield a poisoned result. -
Support the
nuwandnswflags intruncinstructions. Ifnuwornswis set, then performing a truncation that would result in unsigned or signed integer overflow, respectively, will yield a poisoned result. -
Support the
samesignflag inicmpinstructions. Ifsamesignis set, then comparing two integers of different signs will yield a poisoned result. -
Support the
llvm.tan,llvm.a{sin,cos,tan},llvm.{sin,cos,tan}h, andllvm.atan2floating-point intrinsics. -
Add extremely limited support for representing
poisonconstants. For more details on the extent to whichcrucible-llvmcan reason aboutpoison, seedoc/limitations.md.As part of these changes:
LLVMValnow features an additionalLLVMValPoisondata constructor.LLVMExprnow features an additionalPoisonExprdata constructor.LLVMConstnow features an additionPoisonConstdata constructor.LLVMExtensionExprnow featuresLLVM_Poison{BV,Float}data constructors, which represent primitivepoisonvalues.
-
Remove the
Eq LLVMConstinstance. This instance was inherently unreliable because it cannot easily compute a simpleTrue-or-Falseanswer in the presence ofundeforpoisonvalues. -
Replace
Data.Dynamic.DynamicwithSomeFnHandleinMemModel.{doInstallHandle,doLookupHandle}. -
Add pretty-printing functions for use with
Lang.Crucible.Types.ppTypeReprLang.Crucible.LLVM.MemModel.ppLLVMIntrinsicTypesLang.Crucible.LLVM.MemModel.ppLLVMMemIntrinsicTypeLang.Crucible.LLVM.MemModel.Pointer.ppLLVMPointerIntrinsicType
-
Overrides for
strnlen,strcpy,strdup, andstrndupsupported by new APIs inLang.Crucible.LLVM.MemModel.Strings.
0.8.0 -- 2025-11-09
Lang.Crucible.LLVM.MemModel.{loadString,loadMaybeString,strLen}should now be imported fromLang.Crucible.LLVM.MemModel.Strings.- Two new functions for loading C-style null-terminated strings from
LLVM memory were added to
Lang.Crucible.LLVM.MemModel.Strings:loadConcretelyNullTerminatedStringandloadProvablyNullTerminatedString. - Add a new "low-level" API for loading strings to
Lang.Crucible.LLVM.MemModel.Strings:ByteLoader,ByteChecker, andloadBytes. - Support simulating LLVM bitcode files whose data layout strings specify function pointer alignment.
- Fix a bug that would cause the simuator to compute incorrect results for the
llvm.is.fpclassintrinsic. (Among other things, this is used to power theisnanfunction in Clang 17 or later.) - Support vectorized versions of the
llvm.u{min,max}andllvm.s{min,max}intrinsics.
0.7.1 -- 2025-03-21
- Fix a bug in which the memory model would panic when attempting to unpack constant string literals.
0.7 -- 2024-08-30
- Add support for GHC 9.8
- Add integer-related
llvm.vector.reduce.*intrinsics. - Add workaround to allow loading bitcode using LLVM's reltable lookup optimization.
register_llvm_overrides{,_}now returns the list of overrides that were applied.- The
doMallocHandlefunction was removed. - The
RegOverrideMmonad was replaced by theMakeOverridefunction newtype. - Several type parameters were removed from
OverrideTemplate, and theextparameter was added. This had downstream effects inbasic_llvm_override,polymorphic1_llvm_override, and other functions for registering overrides. - Override registration code was generalized.
bind_llvm_{handle,func}now don't require a wholeLLVMContext, just aGlobalVar Mem, and are polymorphic overext. build_llvm_overrideis now generic over theexttype parameter. This should be a backwards-compatible change.LLVMOverridenow has an additionalexttype parameter. See the Haddocks forLLVMOverridefor details and motivation.- The
llvmOverride_deffield ofLLVMOverrideno longer takes abakargument. To retrieve the current symbolic backend, useLang.Crucible.Simulator.OverrideSim.ovrWithBackend. - Add overrides for integer-related
llvm.vector.reduce.*intrinsics. - Add support for atomic
fadd,fsub,fmax,fmin,uinc_wrap, andudec_wrapoperations inatomicrmwinstructions.
0.6 -- 2024-02-05
bindLLVMFunPtrnow accepts anText.LLVM.AST.Symbolrather than a wholeDeclare. UsedecNameto get aSymbolfrom aDeclare.- Implement overrides for the LLVM
llvm.is.fpclass.f*intrinsics. - Implement overrides for the
isinf,__isinf, and__isinffC functions. - Implement overrides for the LLVM
llvm.fma.f*andllvm.fmuladd.f*intrinsics. - Implement overrides for the
fmaandfmafC functions. - Add a
Lang.Crucible.LLVM.MemModel.CallStack.nullfunction. - Add a
ppLLVMLatestfunction toLang.Crucible.LLVM.PrettyPrint, which pretty-prints an LLVM AST using the latest LLVM version thatllvm-prettycurrently supports. Also add derived combinators (ppDeclare,ppIdent, etc.) for calling thellvm-prettyfunctions of the same names in tandem withppLLVMLatest.
0.5
-
Add
?memOpts :: MemOptionsconstraints to the following functions:Lang.Crucible.LLVM.MemModel:doStore,storeRaw,condStoreRaw, andstoreConstRawLang.Crucible.LLVM.Globals:populateGlobalLang.Crucible.LLVM.MemModel.Generic:writeMemandwriteConstMem
-
Lang.Crucible.LLVM:registerModuleFnhas changed type to accommodate lazy loading of Crucible IR. -
Lang.Crucible.LLVM.Translation: TheModuleTranslationrecord is now opaque, thecfgMapis no longer exported andglobalInitMapandmodTransNoncehave become lens-style getters instead of record accessors. CFGs should be retrieved using the newgetTranslatedCFGorgetTranslatedCFGForHandlefunctions. -
Lang.Crucible.LLVM: new functionsregisterLazyModuleFnandregisterLazyModule, which delay the building of Crucible CFGs until the functions in question are actually called. -
executeDirectivesinLang.Crucible.LLVM.Printfnow returns aByteStringinstead of aStringso that we can better preserve the exact bytes used in string arguments, without applying a particular text encoding. -
crucible-llvmnow handles LLVM's opaque pointer types, an alternative representation of pointer types that does not store a pointee type. As a result,MemTypenow has an additionalPtrOpaqueTypeconstructor in addition to the existing (non-opaque)PtrTypeconstructor.LLVM 15 and later use opaque pointers by default, so it is recommended that you add support for
PtrOpaqueType(and opaque pointers in general) going forward.crucible-llvmstill supports both kinds of pointers, so you can fall back to non-opaque pointers if need be. -
A new
Lang.Crucible.LLVM.SimpleLoopInvariantmodule has been added, which provides an execution feature that facilitates reasoning about certain kinds of loops (which may not terminate) using loop invariants. Note that this functionality is very experimental and subject to change in the future.
0.4
-
A new
indeterminateLoadBehaviorflag inMemOptionsnow controls now reading from uninitialized memory works whenlaxLoadsAndStoresis enabled. IfStableSymbolicis chosen, then allocating memory will also initialize it with a fresh symbolic value so that subsequent reads will always return that same value. IfUnstableSymbolicis chosen, then each read from a section of uninitialized memory will return a distinct symbolic value each time.As a result of this change,
?memOpts :: MemOptionsconstraints have been added to the following functions:Lang.Crucible.LLVM.Globals:initializeAllMemory,initializeMemoryConstGlobals,populateGlobals,populateAllGlobals, andpopulateConstGlobalsLang.Crucible.LLVM.MemModel:doAlloca,doCalloc,doInvalidate,doMalloc,doMallocUnbounded,mallocRaw,mallocConstRaw,allocGlobals, andallocGlobal
-
HasLLVMAnnnow has an additionalCallStackargument, which is used for annotating errors with call stacks.