llvm-pretty-bc-parser 0.4.1.0 → 0.4.2.0
raw patch · 15 files changed
+82/−8 lines, 15 filesdep ~llvm-prettynew-uploaderPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: llvm-pretty
API changes (from Hackage documentation)
Files
- CHANGELOG.md +6/−0
- README.md +1/−1
- disasm-test/Main.hs +2/−0
- disasm-test/tests/atomicrmw-faddsub.ll +5/−0
- disasm-test/tests/atomicrmw-faddsub.pre-llvm9.ll +4/−0
- disasm-test/tests/atomicrmw-fmaxmin.ll +5/−0
- disasm-test/tests/atomicrmw-fmaxmin.pre-llvm15.ll +4/−0
- disasm-test/tests/atomicrmw-uincdecwrap.ll +5/−0
- disasm-test/tests/atomicrmw-uincdecwrap.pre-llvm16.ll +4/−0
- disasm-test/tests/atomicrmw.ll +11/−1
- disasm-test/tests/opaque-atomicrmw-uincdecwrap.ll +5/−0
- disasm-test/tests/opaque-atomicrmw-uincdecwrap.pre-llvm16.ll +4/−0
- disasm-test/tests/opaque-atomicrmw.ll +16/−2
- llvm-pretty-bc-parser.cabal +3/−3
- src/Data/LLVM/BitCode/IR/Function.hs +7/−1
CHANGELOG.md view
@@ -1,5 +1,11 @@ # Revision history for llvm-pretty-bc-parser +## 0.4.2.0 (August 2024)++* Add support for GHC 9.8 and drop official support of 9.2.++* Add support for new atomic operations in LLVM 9+.+ ## 0.4.1.0 (January 2024) * Add preliminary support for LLVM versions up through 16.
README.md view
@@ -59,9 +59,9 @@ the developers' documentation for more details and a rationale: [doc/developing.md](./doc/developing.md). Currently supported: -- GHC 9.2.8 - GHC 9.4.5 - GHC 9.6.2+- GHC 9.8.1 [fuzz-workflow]: https://github.com/GaloisInc/llvm-pretty-bc-parser/blob/master/.github/workflows/llvm-quick-fuzz.yml [llvm13]: https://github.com/GaloisInc/llvm-pretty-bc-parser/issues?q=is%3Aopen+is%3Aissue+label%3Allvm%2F13.0
disasm-test/Main.hs view
@@ -372,10 +372,12 @@ , TS.rootName = "*.ll" , TS.separators = "." , TS.validParams = [ ("llvm-range", Just [ "recent-llvm"+ , "pre-llvm9" , "pre-llvm12" , "pre-llvm13" , "pre-llvm14" , "pre-llvm15"+ , "pre-llvm16" ]) ] -- Somewhat unusually for tasty-sugar, we make the expectedSuffix the same
+ disasm-test/tests/atomicrmw-faddsub.ll view
@@ -0,0 +1,5 @@+define void @atomicrmw(float* %a, float %f) {+ %b11 = atomicrmw fadd float* %a, float %f acquire+ %b12 = atomicrmw fsub float* %a, float %f acquire+ ret void+}
+ disasm-test/tests/atomicrmw-faddsub.pre-llvm9.ll view
@@ -0,0 +1,4 @@+SKIP_TEST++This test case requires the use of atomic `fadd` and `fsub` operations, which+are only available in LLVM 9 or later.
+ disasm-test/tests/atomicrmw-fmaxmin.ll view
@@ -0,0 +1,5 @@+define void @atomicrmw(float* %a, float %f) {+ %b13 = atomicrmw fmax float* %a, float %f acquire+ %b14 = atomicrmw fmin float* %a, float %f acquire+ ret void+}
+ disasm-test/tests/atomicrmw-fmaxmin.pre-llvm15.ll view
@@ -0,0 +1,4 @@+SKIP_TEST++This test case requires the use of atomic `fmax` and `fmin` operations, which+are only available in LLVM 15 or later.
+ disasm-test/tests/atomicrmw-uincdecwrap.ll view
@@ -0,0 +1,5 @@+define void @atomicrmw(i32* %a, i32 %i) {+ %b15 = atomicrmw uinc_wrap i32* %a, i32 %i acquire+ %b16 = atomicrmw udec_wrap i32* %a, i32 %i acquire+ ret void+}
+ disasm-test/tests/atomicrmw-uincdecwrap.pre-llvm16.ll view
@@ -0,0 +1,4 @@+SKIP_TEST++This test case requires the use of atomic `uinc_wrap` and `udec_wrap`+operations, which are only available in LLVM 16 or later.
disasm-test/tests/atomicrmw.ll view
@@ -1,4 +1,14 @@ define void @atomicrmw(i32* %a, i32 %i) {- %b = atomicrmw add i32* %a, i32 %i acquire+ %b0 = atomicrmw xchg i32* %a, i32 %i acquire+ %b1 = atomicrmw add i32* %a, i32 %i acquire+ %b2 = atomicrmw sub i32* %a, i32 %i acquire+ %b3 = atomicrmw and i32* %a, i32 %i acquire+ %b4 = atomicrmw nand i32* %a, i32 %i acquire+ %b5 = atomicrmw or i32* %a, i32 %i acquire+ %b6 = atomicrmw xor i32* %a, i32 %i acquire+ %b7 = atomicrmw max i32* %a, i32 %i acquire+ %b8 = atomicrmw min i32* %a, i32 %i acquire+ %b9 = atomicrmw umax i32* %a, i32 %i acquire+ %b10 = atomicrmw umin i32* %a, i32 %i acquire ret void }
+ disasm-test/tests/opaque-atomicrmw-uincdecwrap.ll view
@@ -0,0 +1,5 @@+define void @atomicrmw(ptr %a, i32 %i) {+ %b15 = atomicrmw uinc_wrap ptr %a, i32 %i acquire+ %b16 = atomicrmw udec_wrap ptr %a, i32 %i acquire+ ret void+}
+ disasm-test/tests/opaque-atomicrmw-uincdecwrap.pre-llvm16.ll view
@@ -0,0 +1,4 @@+SKIP_TEST++This test case requires the use of atomic `uinc_wrap` and `udec_wrap`+operations, which are only available in LLVM 16 or later.
disasm-test/tests/opaque-atomicrmw.ll view
@@ -1,4 +1,18 @@-define void @atomicrmw(ptr %a, i32 %i) {- %b = atomicrmw add ptr %a, i32 %i acquire+define void @atomicrmw(ptr %a1, i32 %i, ptr %a2, float %f) {+ %b0 = atomicrmw xchg ptr %a1, i32 %i acquire+ %b1 = atomicrmw add ptr %a1, i32 %i acquire+ %b2 = atomicrmw sub ptr %a1, i32 %i acquire+ %b3 = atomicrmw and ptr %a1, i32 %i acquire+ %b4 = atomicrmw nand ptr %a1, i32 %i acquire+ %b5 = atomicrmw or ptr %a1, i32 %i acquire+ %b6 = atomicrmw xor ptr %a1, i32 %i acquire+ %b7 = atomicrmw max ptr %a1, i32 %i acquire+ %b8 = atomicrmw min ptr %a1, i32 %i acquire+ %b9 = atomicrmw umax ptr %a1, i32 %i acquire+ %b10 = atomicrmw umin ptr %a1, i32 %i acquire+ %b11 = atomicrmw fadd ptr %a2, float %f acquire+ %b12 = atomicrmw fsub ptr %a2, float %f acquire+ %b13 = atomicrmw fmax ptr %a2, float %f acquire+ %b14 = atomicrmw fmin ptr %a2, float %f acquire ret void }
llvm-pretty-bc-parser.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.4 Name: llvm-pretty-bc-parser-Version: 0.4.1.0+Version: 0.4.2.0 License: BSD-3-Clause License-file: LICENSE Author: Trevor Elliott <trevor@galois.com>@@ -10,7 +10,7 @@ Category: Text Build-type: Simple Synopsis: LLVM bitcode parsing library-Tested-with: GHC==8.8, GHC==8.10, GHC==9.2, GHC==9.4, GHC==9.6+Tested-with: GHC==9.4, GHC==9.6, GHC==9.8 Description: A parser for the LLVM bitcode file format, yielding a Module from the@@ -75,7 +75,7 @@ bytestring >= 0.10, containers >= 0.4, fgl >= 5.5,- llvm-pretty >= 0.12 && < 0.13,+ llvm-pretty >= 0.12.1.0 && < 0.13, mtl >= 2.2.2, pretty >= 1.0.1, uniplate >= 1.6,
src/Data/LLVM/BitCode/IR/Function.hs view
@@ -1431,7 +1431,7 @@ getDecodedOrdering i = Assert.unknownEntity "atomic ordering" i --- https://github.com/llvm-mirror/llvm/blob/release_60/include/llvm/Bitcode/LLVMBitCodes.h#L377+-- https://github.com/llvm/llvm-project/blob/e24dc34aa085b9e8d3ea58cc5f59f80bc4c7cdb4/llvm/include/llvm/Bitcode/LLVMBitCodes.h#L468-L489 getDecodedAtomicRWOp :: Integer -> Parse AtomicRWOp getDecodedAtomicRWOp 0 = pure AtomicXchg getDecodedAtomicRWOp 1 = pure AtomicAdd@@ -1444,6 +1444,12 @@ getDecodedAtomicRWOp 8 = pure AtomicMin getDecodedAtomicRWOp 9 = pure AtomicUMax getDecodedAtomicRWOp 10 = pure AtomicUMin+getDecodedAtomicRWOp 11 = pure AtomicFAdd+getDecodedAtomicRWOp 12 = pure AtomicFSub+getDecodedAtomicRWOp 13 = pure AtomicFMax+getDecodedAtomicRWOp 14 = pure AtomicFMin+getDecodedAtomicRWOp 15 = pure AtomicUIncWrap+getDecodedAtomicRWOp 16 = pure AtomicUDecWrap getDecodedAtomicRWOp v = Assert.unknownEntity "atomic RWOp" v {-