[all-commits] [llvm/llvm-project] f7bfa5: [SPIR-V] Fix 64-bit integer literal printing (#66686)

Natalie Chouinard via All-commits all-commits at lists.llvm.org
Wed Sep 20 06:31:28 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f7bfa583b7a5ff0e9954d2810006b7a71123be88
      https://github.com/llvm/llvm-project/commit/f7bfa583b7a5ff0e9954d2810006b7a71123be88
  Author: Natalie Chouinard <1953083+sudonatalie at users.noreply.github.com>
  Date:   2023-09-20 (Wed, 20 Sep 2023)

  Changed paths:
    M llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVInstPrinter.cpp
    M llvm/lib/Target/SPIRV/SPIRVInstrInfo.td
    M llvm/test/CodeGen/SPIRV/atomicrmw.ll
    M llvm/test/CodeGen/SPIRV/constant/local-integers-constants.ll
    M llvm/test/CodeGen/SPIRV/lshr-constexpr.ll
    M llvm/test/CodeGen/SPIRV/uitofp-with-bool.ll

  Log Message:
  -----------
  [SPIR-V] Fix 64-bit integer literal printing (#66686)

Previously, the SPIR-V instruction printer was always printing the first
operand of an `OpConstant`'s literal value as one of the fixed operands.
This is incorrect for 64-bit values, where the first operand is actually
the value's lower-order word and should be combined with the following
higher-order word before printing.

This change fixes that issue by waiting to print the last fixed operand
of `OpConstant` instructions until the variadic operands are ready to be
printed, then using `NumFixedOps - 1` as the starting operand index for
the literal value operands.

Depends on D156049




More information about the All-commits mailing list