[all-commits] [llvm/llvm-project] 236228: [BitcodeReader] Replace unsupported constexprs in ...

Nikita Popov via All-commits all-commits at lists.llvm.org
Thu Oct 5 05:38:43 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 236228f43d018ebf11697610fe6504c167ed6ac8
      https://github.com/llvm/llvm-project/commit/236228f43d018ebf11697610fe6504c167ed6ac8
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2023-10-05 (Thu, 05 Oct 2023)

  Changed paths:
    M llvm/lib/Bitcode/Reader/BitcodeReader.cpp
    M llvm/lib/Bitcode/Reader/MetadataLoader.cpp
    M llvm/lib/Bitcode/Reader/MetadataLoader.h
    A llvm/test/Bitcode/Inputs/constexpr-to-instr-metadata-2.bc
    A llvm/test/Bitcode/constexpr-to-instr-metadata-2.ll
    M llvm/test/Bitcode/constexpr-to-instr-metadata.ll

  Log Message:
  -----------
  [BitcodeReader] Replace unsupported constexprs in metadata with undef

Metadata (via ValueAsMetadata) can reference constant expressions
that may no longer be supported. These references can both be in
function-local metadata and module metadata, if the same expression
is used in multiple functions. At least in theory, such references
could also be in metadata proper, rather than just inside
ValueAsMetadata references in calls.

Instead of trying to expand these expressions (which we can't
reliably do), pretend that the constant has been deleted, which
means that ValueAsMetadata references will get replaced with
undef metadata.

Fixes https://github.com/llvm/llvm-project/issues/68281.




More information about the All-commits mailing list