[all-commits] [llvm/llvm-project] 01edae: [AsmPrinter] Print FP constant in hexadecimal form...

jsji via All-commits all-commits at lists.llvm.org
Fri Feb 7 08:15:40 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 01edae1271778fdc88be668c2e6a828a4c4d1481
      https://github.com/llvm/llvm-project/commit/01edae1271778fdc88be668c2e6a828a4c4d1481
  Author: Jinsong Ji <jji at us.ibm.com>
  Date:   2020-02-07 (Fri, 07 Feb 2020)

  Changed paths:
    M llvm/include/llvm/MC/MCExpr.h
    M llvm/include/llvm/MC/MCStreamer.h
    M llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
    M llvm/lib/MC/MCAsmStreamer.cpp
    M llvm/lib/MC/MCExpr.cpp
    M llvm/test/CodeGen/AArch64/arm64-fp-imm-size.ll
    M llvm/test/CodeGen/AArch64/arm64-fp-imm.ll
    M llvm/test/CodeGen/AArch64/f16-imm.ll
    M llvm/test/CodeGen/AArch64/win_cst_pool.ll
    M llvm/test/CodeGen/ARM/big-endian-neon-fp16-bitconv.ll
    M llvm/test/CodeGen/ARM/constant-islands.ll
    M llvm/test/CodeGen/ARM/constantfp.ll
    M llvm/test/CodeGen/ARM/vecreduce-fadd-legalization-strict.ll
    M llvm/test/CodeGen/ARM/vecreduce-fmul-legalization-strict.ll
    M llvm/test/CodeGen/Mips/cconv/memory-layout.ll
    M llvm/test/CodeGen/PowerPC/aix-lower-constant-pool-index.ll
    M llvm/test/CodeGen/PowerPC/aix-xcoff-data.ll
    M llvm/test/CodeGen/PowerPC/aix-xcoff-rodata.ll
    M llvm/test/CodeGen/PowerPC/float-asmprint.ll
    M llvm/test/CodeGen/PowerPC/mcm-12.ll
    M llvm/test/CodeGen/PowerPC/mcm-4.ll
    M llvm/test/CodeGen/PowerPC/ppcf128-endian.ll
    M llvm/test/CodeGen/PowerPC/pr16573.ll
    M llvm/test/CodeGen/SystemZ/fp-const-03.ll
    M llvm/test/CodeGen/SystemZ/fp-const-04.ll
    M llvm/test/CodeGen/SystemZ/fp-const-05.ll
    M llvm/test/CodeGen/SystemZ/fp-const-06.ll
    M llvm/test/CodeGen/SystemZ/fp-const-07.ll
    M llvm/test/CodeGen/SystemZ/fp-const-08.ll
    M llvm/test/CodeGen/SystemZ/fp-const-09.ll
    M llvm/test/CodeGen/SystemZ/fp-const-10.ll
    M llvm/test/CodeGen/SystemZ/fp-const-11.ll
    M llvm/test/CodeGen/Thumb2/LowOverheadLoops/fast-fp-loops.ll
    M llvm/test/CodeGen/Thumb2/LowOverheadLoops/mve-float-loops.ll
    M llvm/test/CodeGen/Thumb2/aligned-constants.ll
    M llvm/test/CodeGen/Thumb2/constant-islands-new-island-padding.ll
    M llvm/test/CodeGen/Thumb2/mve-ctlz.ll
    M llvm/test/CodeGen/Thumb2/mve-ctpop.ll
    M llvm/test/CodeGen/Thumb2/mve-cttz.ll
    M llvm/test/CodeGen/Thumb2/mve-phireg.ll
    M llvm/test/CodeGen/Thumb2/mve-pred-build-var.ll
    M llvm/test/CodeGen/Thumb2/mve-vecreduce-fadd.ll
    M llvm/test/CodeGen/Thumb2/mve-vecreduce-fminmax.ll
    M llvm/test/CodeGen/WebAssembly/global.ll
    M llvm/test/CodeGen/X86/broadcast-elm-cross-splat-vec.ll
    M llvm/test/CodeGen/X86/copysign-constant-magnitude.ll
    M llvm/test/CodeGen/X86/float-asmprint.ll
    M llvm/test/CodeGen/X86/fp-immediate-shorten.ll
    M llvm/test/CodeGen/X86/fp128-load.ll
    M llvm/test/CodeGen/X86/pr13577.ll
    M llvm/test/CodeGen/X86/pr40730.ll
    M llvm/test/CodeGen/X86/vec-copysign.ll
    M llvm/test/CodeGen/X86/vec_uint_to_fp-fastmath.ll
    M llvm/test/CodeGen/X86/vec_uint_to_fp.ll
    M llvm/test/CodeGen/X86/win_cst_pool.ll
    M llvm/test/CodeGen/X86/x86-setcc-int-to-fp-combine.ll

  Log Message:
  -----------
  [AsmPrinter] Print FP constant in hexadecimal form instead

Printing floating point number in decimal is inconvenient for humans.
Verbose asm output will print out floating point values in comments, it
helps.

But in lots of cases, users still need additional work to covert the
decimal back to hex or binary to check the bit patterns,
especially when there are small precision difference.

Hexadecimal form is one of the supported form in LLVM IR, and easier for
debugging.

This patch try to print all FP constant in hex form instead.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D73566




More information about the All-commits mailing list