Test Failure: Transforms/InstCombine/fold-select-fmul-if-zero.ll

Test source: git

Log:

Source: <stdin>
-- 1. ModuleToFunctionPassAdaptor
-- 1. PassManager<Function> : Skipping NOP
-- 2. InstCombinePass

----------------------------------------
define i32 @fcmp_zero_select_is_not_fp(float %x) denormal-fp-math=preserve-sign,preserve-sign {
#0:
  %x.is.zero = fcmp oeq float %x, 0.000000
  %scaled.x = fmul float %x, 32.000000
  %bitcast.scaled.x = bitcast float %scaled.x to i32
  %bitcast.x = bitcast float %x to i32
  %scaled.if.denormal = select i1 %x.is.zero, i32 %bitcast.scaled.x, i32 %bitcast.x
  ret i32 %scaled.if.denormal
}
Transformation seems to be correct! (syntactically equal)

-- 3. InstCombinePass

----------------------------------------
define i32 @fcmp_zero_select_is_not_fp(float %x) denormal-fp-math=preserve-sign,preserve-sign {
#0:
  %x.is.zero = fcmp oeq float %x, 0.000000
  %scaled.x = fmul float %x, 32.000000
  %bitcast.scaled.x = bitcast float %scaled.x to i32
  %bitcast.x = bitcast float %x to i32
  %scaled.if.denormal = select i1 %x.is.zero, i32 %bitcast.scaled.x, i32 %bitcast.x
  ret i32 %scaled.if.denormal
}
=>
define i32 @fcmp_zero_select_is_not_fp(float %x) denormal-fp-math=preserve-sign,preserve-sign {
#0:
  %scaled.if.denormal = bitcast float %x to i32
  ret i32 %scaled.if.denormal
}
Transformation doesn't verify! (unsound)
ERROR: Value mismatch

Example:
float %x = #x00000004 (0.000000000000?)

Source:
i1 %x.is.zero = #x1 (1)
float %scaled.x = #x00000000 (+0.0)
i32 %bitcast.scaled.x = #x00000000 (0)
i32 %bitcast.x = #x00000004 (4)
i32 %scaled.if.denormal = #x00000000 (0)

Target:
i32 %scaled.if.denormal = #x00000004 (4)
Source value: #x00000000 (0)
Target value: #x00000004 (4)

Pass: InstCombinePass
Command line: '/home/nlopes/llvm/build/bin/opt' '-load=/home/nlopes/alive2/build/tv/tv.so' '-load-pass-plugin=/home/nlopes/alive2/build/tv/tv.so' '-tv-exit-on-error' '-S' '-passes=instcombine' '-denormal-fp-math=preserve-sign' '-tv-smt-to=20000' '-tv-report-dir=/home/nlopes/alive2/build/logs' '-tv-smt-stats'
Wrote bitcode to: "/home/nlopes/alive2/build/logs/in_YfErGnzh_ezMz.bc"


------------------- SMT STATS -------------------
Num queries: 12
Num invalid: 0
Num skips:   0
Num trivial: 12 (50.0%)
Num timeout: 0 (0.0%)
Num errors:  0 (0.0%)
Num SAT:     8 (66.7%)
Num UNSAT:   4 (33.3%)
Alive2: Transform doesn't verify; aborting!

stderr:

RUN: at line 2: /home/nlopes/alive2/build/opt-alive.sh -S -passes=instcombine < /bitbucket/nlopes/llvm/llvm/test/Transforms/InstCombine/fold-select-fmul-if-zero.ll | /bitbucket/nlopes/llvm/build/bin/FileCheck -check-prefixes=CHECK,IEEE /bitbucket/nlopes/llvm/llvm/test/Transforms/InstCombine/fold-select-fmul-if-zero.ll
+ /home/nlopes/alive2/build/opt-alive.sh -S -passes=instcombine
+ /bitbucket/nlopes/llvm/build/bin/FileCheck -check-prefixes=CHECK,IEEE /bitbucket/nlopes/llvm/llvm/test/Transforms/InstCombine/fold-select-fmul-if-zero.ll
RUN: at line 3: /home/nlopes/alive2/build/opt-alive.sh -S -passes=instcombine -denormal-fp-math=preserve-sign < /bitbucket/nlopes/llvm/llvm/test/Transforms/InstCombine/fold-select-fmul-if-zero.ll | /bitbucket/nlopes/llvm/build/bin/FileCheck -check-prefixes=CHECK,DAZ  /bitbucket/nlopes/llvm/llvm/test/Transforms/InstCombine/fold-select-fmul-if-zero.ll
+ /home/nlopes/alive2/build/opt-alive.sh -S -passes=instcombine -denormal-fp-math=preserve-sign
+ /bitbucket/nlopes/llvm/build/bin/FileCheck -check-prefixes=CHECK,DAZ /bitbucket/nlopes/llvm/llvm/test/Transforms/InstCombine/fold-select-fmul-if-zero.ll

FileCheck error: '<stdin>' is empty.
FileCheck command line:  /bitbucket/nlopes/llvm/build/bin/FileCheck -check-prefixes=CHECK,DAZ /bitbucket/nlopes/llvm/llvm/test/Transforms/InstCombine/fold-select-fmul-if-zero.ll

 

<-- Back