[all-commits] [llvm/llvm-project] aeefb1: [IR] Simplify ValueAsMetadata::handleRAUW. NFC (#2...

Fangrui Song via All-commits all-commits at lists.llvm.org
Sun Sep 13 23:36:12 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: aeefb10b01fb7cf11a1917230f10b663d5ec109b
      https://github.com/llvm/llvm-project/commit/aeefb10b01fb7cf11a1917230f10b663d5ec109b
  Author: Fangrui Song <i at maskray.me>
  Date:   2026-09-13 (Sun, 13 Sep 2026)

  Changed paths:
    M llvm/lib/IR/Metadata.cpp
    M llvm/unittests/IR/MetadataTest.cpp

  Log Message:
  -----------
  [IR] Simplify ValueAsMetadata::handleRAUW. NFC (#223301)

Metadata refers to a Value through its unique ValueAsMetadata wrapper.
When a Value is RAUW'd, handleRAUW reuses the old value's wrapper for
the new value if the new value has none yet; otherwise it moves the uses
to the new value's wrapper, with special cases for a local becoming a
constant, a constant becoming a local, and a value moving to another
function.

Always move the uses (or drop them in the last two cases) and delete the
old wrapper, so that a ValueAsMetadata wraps the same value for its
whole life.

Instruction counts for SLPVectorizer.cpp and X86ISelLowering.cpp at -O2
-g are unchanged (-0.04%, -0.01%).

Aided by Opus 5



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list