[PATCH] D101639: Add build_fence to OCaml bindings

Josh Berdine via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 4 07:15:12 PDT 2021


jberdine requested changes to this revision.
jberdine added a comment.
This revision now requires changes to proceed.

There is an issue. The fence instruction always returns type void. An SSA name is not permitted for values of type void. The test complains:

  > ninja bindings/ocaml/all check-llvm-bindings-ocaml
  [17/18] Running lit suite /Users/jjb/src/llvm-project/llvm/test/Bindings/OCaml
  FAIL: LLVM :: Bindings/OCaml/core.ml (1 of 16)
  ******************** TEST 'LLVM :: Bindings/OCaml/core.ml' FAILED ********************
  Script:
  --
  : 'RUN: at line 1';   rm -rf /Users/jjb/src/llvm-project/_build/test/Bindings/OCaml/Output/core.ml.tmp && mkdir -p /Users/jjb/src/llvm-project/_build/test/Bindings/OCaml/Output/core.ml.tmp && cp /Users/jjb/src/llvm-project/llvm/test/Bindings/OCaml/core.ml /Users/jjb/src/llvm-project/_build/test/Bindings/OCaml/Output/core.ml.tmp/core.ml && cp /Users/jjb/src/llvm-project/llvm/test/Bindings/OCaml/Utils/Testsuite.ml /Users/jjb/src/llvm-project/_build/test/Bindings/OCaml/Output/core.ml.tmp/Testsuite.ml
  : 'RUN: at line 2';   /Users/jjb/.opam/sledge/bin/ocamlfind ocamlc -cclib -L/Users/jjb/src/llvm-project/_build/test/../lib  -g -w +A -package llvm.analysis -package llvm.bitwriter -I /Users/jjb/src/llvm-project/_build/test/Bindings/OCaml/Output/core.ml.tmp/ -linkpkg /Users/jjb/src/llvm-project/_build/test/Bindings/OCaml/Output/core.ml.tmp/Testsuite.ml /Users/jjb/src/llvm-project/_build/test/Bindings/OCaml/Output/core.ml.tmp/core.ml -o /Users/jjb/src/llvm-project/_build/test/Bindings/OCaml/Output/core.ml.tmp/executable
  : 'RUN: at line 3';   /Users/jjb/src/llvm-project/_build/test/Bindings/OCaml/Output/core.ml.tmp/executable /Users/jjb/src/llvm-project/_build/test/Bindings/OCaml/Output/core.ml.tmp/bitcode.bc
  : 'RUN: at line 4';   /Users/jjb/.opam/sledge/bin/ocamlfind ocamlopt -cclib -L/Users/jjb/src/llvm-project/_build/test/../lib -cclib -Wl,-rpath,/Users/jjb/src/llvm-project/_build/test/../lib  -g -w +A -package llvm.analysis -package llvm.bitwriter -I /Users/jjb/src/llvm-project/_build/test/Bindings/OCaml/Output/core.ml.tmp/ -linkpkg /Users/jjb/src/llvm-project/_build/test/Bindings/OCaml/Output/core.ml.tmp/Testsuite.ml /Users/jjb/src/llvm-project/_build/test/Bindings/OCaml/Output/core.ml.tmp/core.ml -o /Users/jjb/src/llvm-project/_build/test/Bindings/OCaml/Output/core.ml.tmp/executable
  : 'RUN: at line 5';   /Users/jjb/src/llvm-project/_build/test/Bindings/OCaml/Output/core.ml.tmp/executable /Users/jjb/src/llvm-project/_build/test/Bindings/OCaml/Output/core.ml.tmp/bitcode.bc
  : 'RUN: at line 6';   /Users/jjb/src/llvm-project/_build/bin/llvm-dis < /Users/jjb/src/llvm-project/_build/test/Bindings/OCaml/Output/core.ml.tmp/bitcode.bc > /Users/jjb/src/llvm-project/_build/test/Bindings/OCaml/Output/core.ml.tmp/dis.ll
  : 'RUN: at line 7';   /Users/jjb/src/llvm-project/_build/bin/FileCheck /Users/jjb/src/llvm-project/llvm/test/Bindings/OCaml/core.ml < /Users/jjb/src/llvm-project/_build/test/Bindings/OCaml/Output/core.ml.tmp/dis.ll
  : 'RUN: at line 9';   /Users/jjb/src/llvm-project/_build/bin/FileCheck -check-prefix=CHECK-NOWHERE /Users/jjb/src/llvm-project/llvm/test/Bindings/OCaml/core.ml < /Users/jjb/src/llvm-project/_build/test/Bindings/OCaml/Output/core.ml.tmp/dis.ll
  --
  Exit Code: 134
  
  Command Output (stderr):
  --
  Assertion failed: (!getType()->isVoidTy() && "Cannot assign a name to void values!"), function setNameImpl, file /Users/jjb/src/llvm-project/llvm/lib/IR/Value.cpp, line 331.
  /Users/jjb/src/llvm-project/_build/test/Bindings/OCaml/Output/core.ml.script: line 8: 36476 Abort trap: 6           /Users/jjb/src/llvm-project/_build/test/Bindings/OCaml/Output/core.ml.tmp/executable /Users/jjb/src/llvm-project/_build/test/Bindings/OCaml/Output/core.ml.tmp/bitcode.bc
  
  --
  
  ********************
  ********************
  Failed Tests (1):
    LLVM :: Bindings/OCaml/core.ml
  
  
  Testing Time: 11.17s
    Passed: 15
    Failed:  1



================
Comment at: llvm/test/Bindings/OCaml/core.ml:1177-1181
     ignore (build_extractvalue agg1 1 "build_extractvalue" atentry)
+
+    ignore (build_fence AtomicOrdering.SequentiallyConsistent false "build_fence0" atentry)
+    ignore (build_fence AtomicOrdering.Acquire false "build_fence1" atentry)
+    ignore (build_fence AtomicOrdering.Release true "build_fence2" atentry)
----------------



CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101639/new/

https://reviews.llvm.org/D101639



More information about the llvm-commits mailing list