Test Failure: Transforms/ExpandIRInsts/X86/expand-fp-convert-small.ll

Test source: git

Log:

Source: <stdin>
-- 1. RequireAnalysisPass<LibcallLoweringModuleAnalysis, Module> : Skipping NOP
-- 2. RequireAnalysisPass<LibcallLoweringModuleAnalysis, Module> : Skipping NOP
-- 3. ModuleToFunctionPassAdaptor

----------------------------------------
define i16 @fptosi_f16_i16(half %x) {
#0:
  %res = fptosi half %x to i16
  ret i16 %res
}
Transformation seems to be correct! (syntactically equal)


----------------------------------------
define i24 @fptosi_f16_i24(half %x) {
#0:
  %res = fptosi half %x to i24
  ret i24 %res
}
Transformation seems to be correct! (syntactically equal)


----------------------------------------
define i16 @fptoui_f16_i16(half %x) {
#0:
  %res = fptoui half %x to i16
  ret i16 %res
}
Transformation seems to be correct! (syntactically equal)


----------------------------------------
define i24 @fptoui_f16_i24(half %x) {
#0:
  %res = fptoui half %x to i24
  ret i24 %res
}
Transformation seems to be correct! (syntactically equal)

-- 1. ExpandIRInstsPass

----------------------------------------
define i16 @fptosi_f16_i16(half %x) {
#0:
  %res = fptosi half %x to i16
  ret i16 %res
}
Transformation seems to be correct! (syntactically equal)

-- 2. ExpandIRInstsPass

----------------------------------------
define i16 @fptosi_f16_i16(half %x) {
#0:
  %res = fptosi half %x to i16
  ret i16 %res
}
=>
define i16 @fptosi_f16_i16(half %x) {
fp-to-i-entry:
  %#0 = bitcast half %x to i16
  %#1 = icmp sgt i16 %#0, 65535
  %sign = select i1 %#1, i16 1, i16 65535
  %#2 = lshr i16 %#0, 10
  %biased.exp = and i16 %#2, 31
  %#3 = and i16 %#0, 1023
  %significand = or i16 %#3, 1024
  %exp.is.negative = icmp ult i16 %biased.exp, 15
  br i1 %exp.is.negative, label %fp-to-i-cleanup, label %fp-to-i-if-check.saturate

fp-to-i-if-check.saturate:
  %#4 = add i16 %biased.exp, 65505
  %#5 = icmp ult i16 %#4, 65520
  br i1 %#5, label %fp-to-i-if-saturate, label %fp-to-i-if-check.exp.size

fp-to-i-if-saturate:
  %saturated = select i1 %#1, i16 32767, i16 32768
  br label %fp-to-i-cleanup

fp-to-i-if-check.exp.size:
  %exp.smaller.mantissa.width = icmp ult i16 %biased.exp, 25
  br i1 %exp.smaller.mantissa.width, label %fp-to-i-if-exp.small, label %fp-to-i-if-exp.large

fp-to-i-if-exp.small:
  %#6 = sub i16 25, %biased.exp
  %#7 = lshr i16 %significand, %#6
  %#8 = mul i16 %#7, %sign
  br label %fp-to-i-cleanup

fp-to-i-if-exp.large:
  %#9 = add i16 %biased.exp, 65511
  %#10 = shl i16 %significand, %#9
  %#11 = mul i16 %#10, %sign
  br label %fp-to-i-cleanup

fp-to-i-cleanup:
  %#12 = phi i16 [ %saturated, %fp-to-i-if-saturate ], [ %#8, %fp-to-i-if-exp.small ], [ %#11, %fp-to-i-if-exp.large ], [ 0, %fp-to-i-entry ]
  ret i16 %#12
}
Transformation doesn't verify! (unsound)
ERROR: Source is more defined than target

Example:
half %x = poison

Source:
i16 %res = poison

Target:
i16 %#0 = poison
i1 %#1 = poison
i16 %sign = poison
i16 %#2 = poison
i16 %biased.exp = poison
i16 %#3 = poison
i16 %significand = poison
i1 %exp.is.negative = poison
UB triggered on br


Pass: ExpandIRInstsPass
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' '-mtriple=x86_64--' '-passes=require<libcall-lowering-info>,expand-ir-insts' '-expand-fp-convert-bits=0' '-tv-smt-to=20000' '-tv-report-dir=/home/nlopes/alive2/build/logs' '-tv-smt-stats'

Wrote bitcode to: "/home/nlopes/alive2/build/logs/in_3N2qIF3V_Z0Wj.bc"

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

stderr:

Transforms/ExpandIRInsts/X86/expand-fp-convert-small.ll' FAILED ********************
Exit Code: 2

Command Output (stdout):
--
# RUN: at line 2
/home/nlopes/alive2/build/opt-alive.sh -S -mtriple=x86_64-- -passes='require<libcall-lowering-info>,expand-ir-insts' -expand-fp-convert-bits=0 < /bitbucket/nlopes/llvm/llvm/test/Transforms/ExpandIRInsts/X86/expand-fp-convert-small.ll | /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/ExpandIRInsts/X86/expand-fp-convert-small.ll
# executed command: /home/nlopes/alive2/build/opt-alive.sh -S -mtriple=x86_64-- '-passes=require<libcall-lowering-info>,expand-ir-insts' -expand-fp-convert-bits=0
# .---command stderr------------
# `-----------------------------
# error: command failed with exit status: 1
# executed command: /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/ExpandIRInsts/X86/expand-fp-convert-small.ll
# .---command stderr------------
# | FileCheck error: '<stdin>' is empty.
# | FileCheck command line:  /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/ExpandIRInsts/X86/expand-fp-convert-small.ll
# `-----------------------------
# error: command failed with exit status: 2

--

 

<-- Back