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
  %bo = fadd reassoc double %ext, %y
  %r = fptrunc double %bo to float
  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
  %bo = fadd reassoc double %ext, %y
  %r = fptrunc double %bo to float
  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
  %bo = fsub reassoc double %y, %ext
  %r = fptrunc double %bo to half
  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
  %bo = fsub reassoc double %y, %ext
  %r = fptrunc double %bo to half
  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
  %r = fptrunc <2 x double> %bo to <2 x float>
  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
  %r = fptrunc <2 x double> %bo to <2 x float>
  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 }
  %r = fptrunc <2 x float> %bo to <2 x half>
  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 }
  %r = fptrunc <2 x float> %bo to <2 x half>
  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
  %sel = select fast i1 %cond, double %y, double %e
  %r = fptrunc double %sel to float
  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
  %sel = select fast i1 %cond, double %y, double %e
  %r = fptrunc double %sel to float
  ret float %r
}
=>
define float @fptrunc_select_true_val(float %x, double %y, i1 %cond) {
%0:
  %1 = fptrunc double %y to float
  %narrow.sel = select fast i1 %cond, float %1, float %x
  ret float %narrow.sel
}
Transformation doesn't verify! (not unsound)
ERROR: Timeout
-- 20. PassManager<Function> : Skipping NOP
-- 21. PassManager<Function> : Skipping NOP
-- 22. InstCombinePass

----------------------------------------
define <2 x float> @fptrunc_select_false_val(<2 x float> %x, <2 x double> %y, <2 x i1> %cond) {
%0:
  %e = fpext <2 x float> %x to <2 x double>
  %sel = select nnan <2 x i1> %cond, <2 x double> %e, <2 x double> %y
  %r = fptrunc <2 x double> %sel to <2 x float>
  ret <2 x float> %r
}
Transformation seems to be correct! (syntactically equal)

-- 23. InstCombinePass

----------------------------------------
define <2 x float> @fptrunc_select_false_val(<2 x float> %x, <2 x double> %y, <2 x i1> %cond) {
%0:
  %e = fpext <2 x float> %x to <2 x double>
  %sel = select nnan <2 x i1> %cond, <2 x double> %e, <2 x double> %y
  %r = fptrunc <2 x double> %sel to <2 x float>
  ret <2 x float> %r
}
=>
define <2 x float> @fptrunc_select_false_val(<2 x float> %x, <2 x double> %y, <2 x i1> %cond) {
%0:
  %1 = fptrunc <2 x double> %y to <2 x float>
  %narrow.sel = select nnan <2 x i1> %cond, <2 x float> %x, <2 x float> %1
  ret <2 x float> %narrow.sel
}
Transformation doesn't verify! (not unsound)
ERROR: Timeout
-- 24. PassManager<Function> : Skipping NOP
-- 25. PassManager<Function> : Skipping NOP
-- 26. InstCombinePass

----------------------------------------
define half @fptrunc_select_true_val_extra_use(half %x, float %y, i1 %cond) {
%0:
  %e = fpext half %x to float
  call void @use(float %e)
  %sel = select ninf i1 %cond, float %y, float %e
  %r = fptrunc float %sel to half
  ret half %r
}
Transformation seems to be correct! (syntactically equal)

-- 27. InstCombinePass

----------------------------------------
define half @fptrunc_select_true_val_extra_use(half %x, float %y, i1 %cond) {
%0:
  %e = fpext half %x to float
  call void @use(float %e)
  %sel = select ninf i1 %cond, float %y, float %e
  %r = fptrunc float %sel to half
  ret half %r
}
=>
define half @fptrunc_select_true_val_extra_use(half %x, float %y, i1 %cond) {
%0:
  %e = fpext half %x to float
  call void @use(float %e)
  %1 = fptrunc float %y to half
  %narrow.sel = select ninf i1 %cond, half %1, half %x
  ret half %narrow.sel
}
Transformation doesn't verify! (unsound)
ERROR: Target is more poisonous than source

Example:
half %x = poison
float %y = #x6000428c (36968413267782270976)
i1 %cond = #x1 (1)

Source:
float %e = poison
Function @use returned
float %sel = #x6000428c (36968413267782270976)
half %r = #x7c00 (+oo)

SOURCE MEMORY STATE
===================
NON-LOCAL BLOCKS:
Block 0 >	size: 0	align: 1	alloc type: 0	address: 0
Block 1 >	size: 0	align: 1	alloc type: 0	address: 0

Target:
float %e = poison
Function @use returned
half %1 = #x7c00 (+oo)
half %narrow.sel = poison
Source value: #x7c00 (+oo)
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'
Wrote bitcode to: "/home/nlopes/alive2/build/logs/in_8WYrdXpF_AZaR.bc"


------------------- SMT STATS -------------------
Num queries: 14
Num invalid: 0
Num skips:   0
Num trivial: 10 (41.7%)
Num timeout: 2 (14.3%)
Num errors:  0 (0.0%)
Num SAT:     10 (71.4%)
Num UNSAT:   2 (14.3%)
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