[PATCH] D61675: [WIP] Update IRBuilder::CreateFNeg(...) to return a UnaryOperator

Cameron McInally via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 14 15:08:31 PDT 2019


cameron.mcinally updated this revision to Diff 215255.
cameron.mcinally added a comment.
Herald added subscribers: arphaman, kbarton, nemanjai.

Updated patch to generate unary FNeg in Clang.

New perf numbers:

  llvm-project/test-suite-build> ../test-suite/utils/compare.py --filter-short stock1.json stock2.json stock3.json stock4.json stock5.json vs fneg1.json fneg2.json fneg3.json fneg4.json fneg5.json 
  Warning: 'test-suite :: MicroBenchmarks/XRay/FDRMode/fdrmode-bench.test' has No metrics!
  Warning: 'test-suite :: MicroBenchmarks/XRay/ReturnReference/retref-bench.test' has No metrics!
  Warning: 'test-suite :: MicroBenchmarks/XRay/FDRMode/fdrmode-bench.test' has No metrics!
  Warning: 'test-suite :: MicroBenchmarks/XRay/ReturnReference/retref-bench.test' has No metrics!
  Warning: 'test-suite :: MicroBenchmarks/XRay/FDRMode/fdrmode-bench.test' has No metrics!
  Warning: 'test-suite :: MicroBenchmarks/XRay/ReturnReference/retref-bench.test' has No metrics!
  Warning: 'test-suite :: MicroBenchmarks/XRay/FDRMode/fdrmode-bench.test' has No metrics!
  Warning: 'test-suite :: MicroBenchmarks/XRay/ReturnReference/retref-bench.test' has No metrics!
  Warning: 'test-suite :: MicroBenchmarks/XRay/FDRMode/fdrmode-bench.test' has No metrics!
  Warning: 'test-suite :: MicroBenchmarks/XRay/ReturnReference/retref-bench.test' has No metrics!
  Warning: 'test-suite :: MicroBenchmarks/XRay/FDRMode/fdrmode-bench.test' has No metrics!
  Warning: 'test-suite :: MicroBenchmarks/XRay/ReturnReference/retref-bench.test' has No metrics!
  Warning: 'test-suite :: MicroBenchmarks/XRay/FDRMode/fdrmode-bench.test' has No metrics!
  Warning: 'test-suite :: MicroBenchmarks/XRay/ReturnReference/retref-bench.test' has No metrics!
  Warning: 'test-suite :: MicroBenchmarks/XRay/FDRMode/fdrmode-bench.test' has No metrics!
  Warning: 'test-suite :: MicroBenchmarks/XRay/ReturnReference/retref-bench.test' has No metrics!
  Warning: 'test-suite :: MicroBenchmarks/XRay/FDRMode/fdrmode-bench.test' has No metrics!
  Warning: 'test-suite :: MicroBenchmarks/XRay/ReturnReference/retref-bench.test' has No metrics!
  Warning: 'test-suite :: MicroBenchmarks/XRay/FDRMode/fdrmode-bench.test' has No metrics!
  Warning: 'test-suite :: MicroBenchmarks/XRay/ReturnReference/retref-bench.test' has No metrics!
  Tests: 1151
  Short Running: 799 (filtered out)
  Remaining: 352
  Metric: exec_time
  
  Program                                        lhs    rhs    diff 
   test-suite...ProxyApps-C++/CLAMR/CLAMR.test     1.01   0.97 -4.3%
   test-suite...late.test:BENCHMARK_DILATE/128   104.11 107.70  3.4%
   test-suite.../Benchmarks/nbench/nbench.test     1.04   1.01 -3.2%
   test-suite...s/MallocBench/cfrac/cfrac.test     0.63   0.61 -3.1%
   test-suite.../Trimaran/enc-rc4/enc-rc4.test     0.65   0.66  3.0%
   test-suite...e/Benchmarks/Misc/salsa20.test     3.95   3.85 -2.7%
   test-suite...ut-C++/Shootout-C++-sieve.test     1.23   1.26  2.5%
   test-suite...hootout/Shootout-heapsort.test     1.50   1.46 -2.4%
   test-suite.../Applications/spiff/spiff.test     1.01   1.03  2.3%
   test-suite...:BM_FIND_FIRST_MIN_LAMBDA/5001     2.88   2.82 -2.2%
   test-suite...lications/sqlite3/sqlite3.test     1.50   1.54  2.1%
   test-suite...-flt/LinearDependence-flt.test     1.38   1.35 -2.1%
   test-suite...s/gramschmidt/gramschmidt.test     1.73   1.76  2.0%
   test-suite...test:BM_PRESSURE_CALC_RAW/5001     9.40   9.59  2.0%
   test-suite...ications/JM/lencod/lencod.test     2.89   2.94  1.8%
   Geomean difference                                           nan%
                   lhs            rhs        diff
  count  350.000000     351.000000     349.000000
  mean   1998.973248    1997.490274   -0.000602  
  std    16776.472077   16804.318859   0.007581  
  min    0.604400       0.602700      -0.043298  
  25%    1.761900       1.753700      -0.001977  
  50%    6.234300       5.989400      -0.000066  
  75%    104.102761     104.041111     0.000735  
  max    215062.448333  215082.720667  0.034431  

I believe these results are in the noise range for my machine. I examined the assembly for the listed tests, and some others, but no differences were found***.

- There were some IR differences from Value name uniquing, but I believe that's to be expected. I.e. there were less sub's and new fneg's. The missing sub's appear to affect alloca names and such. E.g.:

  5239c5239
  <   %i780 = alloca i32, align 4
  ---
  >   %i779 = alloca i32, align 4


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61675/new/

https://reviews.llvm.org/D61675

Files:
  clang/lib/CodeGen/CGExprScalar.cpp
  clang/test/CodeGen/aarch64-neon-2velem.c
  clang/test/CodeGen/aarch64-neon-fma.c
  clang/test/CodeGen/aarch64-neon-intrinsics.c
  clang/test/CodeGen/aarch64-neon-misc.c
  clang/test/CodeGen/aarch64-neon-scalar-x-indexed-elem.c
  clang/test/CodeGen/aarch64-v8.2a-fp16-intrinsics.c
  clang/test/CodeGen/aarch64-v8.2a-neon-intrinsics.c
  clang/test/CodeGen/arm-v8.2a-neon-intrinsics.c
  clang/test/CodeGen/arm_neon_intrinsics.c
  clang/test/CodeGen/avx512f-builtins.c
  clang/test/CodeGen/avx512vl-builtins.c
  clang/test/CodeGen/builtins-ppc-vsx.c
  clang/test/CodeGen/complex-math.c
  clang/test/CodeGen/exprs.c
  clang/test/CodeGen/fma-builtins.c
  clang/test/CodeGen/fma4-builtins.c
  clang/test/CodeGen/fp16-ops.c
  clang/test/CodeGen/zvector.c
  clang/test/CodeGen/zvector2.c
  llvm/include/llvm/IR/IRBuilder.h
  llvm/test/CodeGen/AMDGPU/amdgpu-codegenprepare-idiv.ll
  llvm/test/CodeGen/AMDGPU/divrem24-assume.ll
  llvm/test/Transforms/InstCombine/cos-1.ll
  llvm/test/Transforms/InstCombine/fast-math.ll
  llvm/test/Transforms/InstCombine/select-crash.ll
  llvm/unittests/IR/InstructionsTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61675.215255.patch
Type: text/x-patch
Size: 225688 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190814/dfcae933/attachment-0001.bin>


More information about the llvm-commits mailing list