[PATCH] D79187: [DAGCombiner] fold (fp_round (int_to_fp X)) -> (int_to_fp X)

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 1 17:17:04 PDT 2020


efriedma added a comment.

>From http://volta.cs.utah.edu:8080/z/d6wpw5:

  ----------------------------------------
  define float @src(i64 %x) {
  %0:
    %xx = sitofp i64 %x to double
    %xxx = fptrunc double %xx to float
    ret float %xxx
  }
  =>
  define float @tgt(i64 %x) {
  %0:
    %xx = sitofp i64 %x to float
    ret float %xx
  }
  Transformation doesn't verify!
  ERROR: Value mismatch
  
  Example:
  i64 %x = #x0810400800000010 (581034755034710032)
  
  Source:
  double %xx = #x43a0208010000000 (581034755034710016)
  float %xxx = #x5d010400 (581034720674971648)
  
  Target:
  float %xx = #x5d010401 (581034789394448384)
  Source value: #x5d010400 (581034720674971648)
  Target value: #x5d010401 (581034789394448384)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79187





More information about the llvm-commits mailing list