Test Failure: Transforms/InstCombine/fptrunc.ll

Test source: git

Comments: LLVM PR49080

Log:

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

----------------------------------------
define float @fadd_fpext_op0(float %x, double %y) {
%0:
  %ext = fpext float %x to double, exceptions=ignore
  %bo = fadd reassoc double %ext, %y, exceptions=ignore
  %r = fptrunc double %bo to float, exceptions=ignore
  ret float %r
}
Transformation seems to be correct! (syntactically equal)

-- 3. InstCombinePass

----------------------------------------
define float @fadd_fpext_op0(float %x, double %y) {
%0:
  %ext = fpext float %x to double, exceptions=ignore
  %bo = fadd reassoc double %ext, %y, exceptions=ignore
  %r = fptrunc double %bo to float, exceptions=ignore
  ret float %r
}
Transformation seems to be correct! (syntactically equal)

-- 4. PassManager<Function> : Skipping NOP
-- 5. PassManager<Function> : Skipping NOP
-- 6. InstCombinePass

----------------------------------------
define half @fsub_fpext_op1(half %x, double %y) {
%0:
  %ext = fpext half %x to double, exceptions=ignore
  %bo = fsub reassoc double %y, %ext, exceptions=ignore
  %r = fptrunc double %bo to half, exceptions=ignore
  ret half %r
}
Transformation seems to be correct! (syntactically equal)

-- 7. InstCombinePass

----------------------------------------
define half @fsub_fpext_op1(half %x, double %y) {
%0:
  %ext = fpext half %x to double, exceptions=ignore
  %bo = fsub reassoc double %y, %ext, exceptions=ignore
  %r = fptrunc double %bo to half, exceptions=ignore
  ret half %r
}
Transformation seems to be correct! (syntactically equal)

-- 8. PassManager<Function> : Skipping NOP
-- 9. PassManager<Function> : Skipping NOP
-- 10. InstCombinePass

----------------------------------------
define <2 x float> @fdiv_constant_op0(<2 x double> %x) {
%0:
  %bo = fdiv reassoc <2 x double> { 42.100000, -0.100000 }, %x, exceptions=ignore
  %r = fptrunc <2 x double> %bo to <2 x float>, exceptions=ignore
  ret <2 x float> %r
}
Transformation seems to be correct! (syntactically equal)

-- 11. InstCombinePass

----------------------------------------
define <2 x float> @fdiv_constant_op0(<2 x double> %x) {
%0:
  %bo = fdiv reassoc <2 x double> { 42.100000, -0.100000 }, %x, exceptions=ignore
  %r = fptrunc <2 x double> %bo to <2 x float>, exceptions=ignore
  ret <2 x float> %r
}
Transformation seems to be correct! (syntactically equal)

-- 12. PassManager<Function> : Skipping NOP
-- 13. PassManager<Function> : Skipping NOP
-- 14. InstCombinePass

----------------------------------------
define <2 x half> @fmul_constant_op1(<2 x float> %x) {
%0:
  %bo = fmul reassoc <2 x float> %x, { 340282346638528859811704183484516925440.000000, 0.500000 }, exceptions=ignore
  %r = fptrunc <2 x float> %bo to <2 x half>, exceptions=ignore
  ret <2 x half> %r
}
Transformation seems to be correct! (syntactically equal)

-- 15. InstCombinePass

----------------------------------------
define <2 x half> @fmul_constant_op1(<2 x float> %x) {
%0:
  %bo = fmul reassoc <2 x float> %x, { 340282346638528859811704183484516925440.000000, 0.500000 }, exceptions=ignore
  %r = fptrunc <2 x float> %bo to <2 x half>, exceptions=ignore
  ret <2 x half> %r
}
Transformation seems to be correct! (syntactically equal)

-- 16. PassManager<Function> : Skipping NOP
-- 17. PassManager<Function> : Skipping NOP
-- 18. InstCombinePass

----------------------------------------
define float @fptrunc_select_true_val(float %x, double %y, i1 %cond) {
%0:
  %e = fpext float %x to double, exceptions=ignore
  %sel = select fast i1 %cond, double %y, double %e
  %r = fptrunc double %sel to float, exceptions=ignore
  ret float %r
}
Transformation seems to be correct! (syntactically equal)

-- 19. InstCombinePass

----------------------------------------
define float @fptrunc_select_true_val(float %x, double %y, i1 %cond) {
%0:
  %e = fpext float %x to double, exceptions=ignore
  %sel = select fast i1 %cond, double %y, double %e
  %r = fptrunc double %sel to float, exceptions=ignore
  ret float %r
}
=>
define float @fptrunc_select_true_val(float %x, double %y, i1 %cond) {
%0:
  %1 = fptrunc double %y to float, exceptions=ignore
  %narrow.sel = select fast i1 %cond, float %1, float %x
  ret float %narrow.sel
}
Transformation doesn't verify! (unsound)
ERROR: Target is more poisonous than source

Example:
float %x = poison
double %y = #xdc00801294000000 (-1499130624361769755889761906382016743717849258946363982501728830343047834739625255054533061859394055703122371110969563150781558439280640)
i1 %cond = #x1 (1)

Source:
double %e = poison
double %sel = #x0000000000000000 (+0.0)
float %r = #x00000000 (+0.0)

Target:
float %1 = #xff800000 (QNaN)
float %narrow.sel = poison
Source value: #x00000000 (+0.0)
Target value: poison

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' '-passes=instcombine' '-S' '-tv-smt-to=20000' '-tv-report-dir=/home/nlopes/alive2/build/logs' '-tv-smt-stats'


------------------- SMT STATS -------------------
Num queries: 6
Num invalid: 0
Num skips:   0
Num trivial: 8 (57.1%)
Num timeout: 0 (0.0%)
Num errors:  0 (0.0%)
Num SAT:     6 (100.0%)
Num UNSAT:   0 (0.0%)
Alive2: Transform doesn't verify; aborting!

stderr:

+ : 'RUN: at line 2'
+ /home/nlopes/alive2/build/opt-alive.sh -passes=instcombine -S
+ /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/InstCombine/fptrunc.ll

FileCheck error: '<stdin>' is empty.
FileCheck command line:  /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/InstCombine/fptrunc.ll

 

<-- Back