Page MenuHomePhabricator

[Bitcode][Asm] Parse metadata value from operand bundles
AbandonedPublic

Authored by necipfazil on Jul 21 2021, 10:40 PM.

Details

Summary

Support parsing operand bundles with metadata value from LLVM IR.

Diff Detail

Unit TestsFailed

TimeTest
40 msx64 debian > LLVM.Bitcode::2021-07-22-Metadata-Operand-Bundles.ll
Script: -- : 'RUN: at line 2'; /var/lib/buildkite-agent/builds/llvm-project/build/bin/llvm-as < /var/lib/buildkite-agent/builds/llvm-project/llvm/test/Bitcode/2021-07-22-Metadata-Operand-Bundles.ll | /var/lib/buildkite-agent/builds/llvm-project/build/bin/llvm-dis | /var/lib/buildkite-agent/builds/llvm-project/build/bin/FileCheck /var/lib/buildkite-agent/builds/llvm-project/llvm/test/Bitcode/2021-07-22-Metadata-Operand-Bundles.ll
60 msx64 debian > LLVM.Bitcode::compatibility.ll
Script: -- : 'RUN: at line 8'; /var/lib/buildkite-agent/builds/llvm-project/build/bin/llvm-as < /var/lib/buildkite-agent/builds/llvm-project/llvm/test/Bitcode/compatibility.ll | /var/lib/buildkite-agent/builds/llvm-project/build/bin/llvm-dis | /var/lib/buildkite-agent/builds/llvm-project/build/bin/llvm-as | /var/lib/buildkite-agent/builds/llvm-project/build/bin/llvm-dis | /var/lib/buildkite-agent/builds/llvm-project/build/bin/FileCheck /var/lib/buildkite-agent/builds/llvm-project/llvm/test/Bitcode/compatibility.ll
20 msx64 debian > LLVM.Bitcode::operand-bundles.ll
Script: -- : 'RUN: at line 1'; /var/lib/buildkite-agent/builds/llvm-project/build/bin/llvm-as < /var/lib/buildkite-agent/builds/llvm-project/llvm/test/Bitcode/operand-bundles.ll | /var/lib/buildkite-agent/builds/llvm-project/build/bin/llvm-dis | /var/lib/buildkite-agent/builds/llvm-project/build/bin/FileCheck /var/lib/buildkite-agent/builds/llvm-project/llvm/test/Bitcode/operand-bundles.ll
2,880 msx64 debian > libarcher.critical::critical.c
Script: -- : 'RUN: at line 15'; /var/lib/buildkite-agent/builds/llvm-project/build/./bin/clang -fopenmp -pthread -fno-experimental-isel -g -O1 -fsanitize=thread -I /var/lib/buildkite-agent/builds/llvm-project/openmp/tools/archer/tests -I /var/lib/buildkite-agent/builds/llvm-project/build/projects/openmp/runtime/src -L /var/lib/buildkite-agent/builds/llvm-project/build/lib -Wl,-rpath,/var/lib/buildkite-agent/builds/llvm-project/build/lib /var/lib/buildkite-agent/builds/llvm-project/openmp/tools/archer/tests/critical/critical.c -o /var/lib/buildkite-agent/builds/llvm-project/build/projects/openmp/tools/archer/tests/critical/Output/critical.c.tmp -latomic && env TSAN_OPTIONS='ignore_noninstrumented_modules=0:ignore_noninstrumented_modules=1' /var/lib/buildkite-agent/builds/llvm-project/build/projects/openmp/tools/archer/tests/critical/Output/critical.c.tmp 2>&1 | tee /var/lib/buildkite-agent/builds/llvm-project/build/projects/openmp/tools/archer/tests/critical/Output/critical.c.tmp.log | /var/lib/buildkite-agent/builds/llvm-project/build/./bin/FileCheck /var/lib/buildkite-agent/builds/llvm-project/openmp/tools/archer/tests/critical/critical.c
3,010 msx64 debian > libarcher.parallel::parallel-simple2.c
Script: -- : 'RUN: at line 15'; /var/lib/buildkite-agent/builds/llvm-project/build/./bin/clang -fopenmp -pthread -fno-experimental-isel -g -O1 -fsanitize=thread -I /var/lib/buildkite-agent/builds/llvm-project/openmp/tools/archer/tests -I /var/lib/buildkite-agent/builds/llvm-project/build/projects/openmp/runtime/src -L /var/lib/buildkite-agent/builds/llvm-project/build/lib -Wl,-rpath,/var/lib/buildkite-agent/builds/llvm-project/build/lib /var/lib/buildkite-agent/builds/llvm-project/openmp/tools/archer/tests/parallel/parallel-simple2.c -o /var/lib/buildkite-agent/builds/llvm-project/build/projects/openmp/tools/archer/tests/parallel/Output/parallel-simple2.c.tmp -latomic && env TSAN_OPTIONS='ignore_noninstrumented_modules=0:ignore_noninstrumented_modules=1' /var/lib/buildkite-agent/builds/llvm-project/build/projects/openmp/tools/archer/tests/parallel/Output/parallel-simple2.c.tmp 2>&1 | tee /var/lib/buildkite-agent/builds/llvm-project/build/projects/openmp/tools/archer/tests/parallel/Output/parallel-simple2.c.tmp.log | /var/lib/buildkite-agent/builds/llvm-project/build/./bin/FileCheck /var/lib/buildkite-agent/builds/llvm-project/openmp/tools/archer/tests/parallel/parallel-simple2.c
View Full Test Results (23 Failed)

Event Timeline

necipfazil created this revision.Jul 21 2021, 10:40 PM
necipfazil requested review of this revision.Jul 21 2021, 10:40 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 21 2021, 10:40 PM

This is needed for D105909 since it attaches type identifiers to call sites as operand bundles with metadata value. Now we can successfully compile LLVM IR with metadata operand bundles to object file while preserving the bundle value.

On the other hand, we cannot read metadata value in and out, i.e., operand bundle value is garbage when LLVM IR is compiled to bitcode, then disassembled back to LLVM IR. One of the tests [1] is a small reproducer.

[1] llvm/test/Bitcode/2021-07-22-Metadata-Operand-Bundles.ll

necipfazil abandoned this revision.Jul 28 2021, 11:21 PM

Abandoning this revision since it is split to two:

  1. D107038: Fix parser to read metadata operand bundle values in.
  2. D107039: Add tests to reproduce the bug in reading metadata operand bundle values out, and additional tests to test the fix to the issue.

This split allows the metadata-operand-bundle-value producer/consumer revisions (D105909 and D105915) to progress with the fix revision 1 above, without waiting for a fix to revision-2.