[all-commits] [llvm/llvm-project] 6f3711: [AsmParser] Don't require value numbers to be cons...

Nikita Popov via All-commits all-commits at lists.llvm.org
Fri Jan 19 05:55:42 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6f371149c1c9f24bede8a799b7c2c9562740aa62
      https://github.com/llvm/llvm-project/commit/6f371149c1c9f24bede8a799b7c2c9562740aa62
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2024-01-19 (Fri, 19 Jan 2024)

  Changed paths:
    M llvm/docs/LangRef.rst
    M llvm/include/llvm/AsmParser/LLParser.h
    M llvm/lib/AsmParser/LLParser.cpp
    M llvm/test/Assembler/call-nonzero-program-addrspace-2.ll
    R llvm/test/Assembler/invalid-arg-num-1.ll
    R llvm/test/Assembler/invalid-arg-num-2.ll
    R llvm/test/Assembler/invalid-arg-num-3.ll
    R llvm/test/Assembler/invalid-block-label-num.ll
    A llvm/test/Assembler/skip-value-numbers-invalid.ll
    A llvm/test/Assembler/skip-value-numbers.ll

  Log Message:
  -----------
  [AsmParser] Don't require value numbers to be consecutive (#78171)

Currently, the IR parser requires that %n style numbered values are
consecutive. This means that the IR becomes invalid as soon as you
remove an instruction, argument or block. This makes it very annoying to
modify IR without running it through instnamer first.

I don't think there is any good reason to impose this requirement. This
PR relaxes it to allow value IDs to be non-consecutive, but it still
keeps the requirement that they're increasing (i.e. you can't skip a
value number and then assign it later).

This only implements support for skipping numbers for local values. We
should extend this to global values in the future as well.




More information about the All-commits mailing list