[PATCH] D36875: [Sparc] efficient pattern for UINT_TO_FP conversion

Alexey Lapshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 18 07:32:19 PDT 2017


alexey.lapshin created this revision.

  while investigating performance degradation of imagick benchmark
  there were found inefficient pattern for UINT_TO_FP conversion.
  That pattern causes RAW hazard in assembly code. Specifically,
  uitofp IR operator results in poor assembler :
  
  st          %i0, [%fp - 952]
  ldd         [%fp - 952], %f0 
  
  it stores 32-bit integer register into memory location and then 
  loads 64-bit floating point data from that location. 
  That is exactly RAW hazard case. To optimize that case it is 
  possible to use SPISD::ITOF and SPISD::XTOF for conversion from 
  integer to floating point data type and to use ISD::BITCAST to 
  copy from integer register into floating point register.  
  The fix is to write custom UINT_TO_FP pattern using SPISD::ITOF,
  SPISD::XTOF, ISD::BITCAST.


https://reviews.llvm.org/D36875

Files:
  lib/Target/Sparc/SparcISelLowering.cpp
  lib/Target/Sparc/SparcISelLowering.h
  lib/Target/Sparc/SparcInstrVIS.td
  test/CodeGen/SPARC/float.ll
  test/CodeGen/SPARC/uint_to_fp.ll
  test/CodeGen/SPARC/vis3.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36875.111671.patch
Type: text/x-patch
Size: 10984 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170818/36576612/attachment.bin>


More information about the llvm-commits mailing list