Test Failure: Transforms/InstCombine/bit_floor.ll

Test source: git

Log:

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

----------------------------------------
define i32 @bit_floor_32(i32 %x) {
%0:
  %eq0 = icmp eq i32 %x, 0
  %lshr = lshr i32 %x, 1
  %ctlz = ctlz i32 %lshr, 0
  %sub = sub i32 32, %ctlz
  %shl = shl i32 1, %sub
  %sel = select i1 %eq0, i32 0, i32 %shl
  ret i32 %sel
}
Transformation seems to be correct! (syntactically equal)

-- 3. InstCombinePass

----------------------------------------
define i32 @bit_floor_32(i32 %x) {
%0:
  %eq0 = icmp eq i32 %x, 0
  %lshr = lshr i32 %x, 1
  %ctlz = ctlz i32 %lshr, 0
  %sub = sub i32 32, %ctlz
  %shl = shl i32 1, %sub
  %sel = select i1 %eq0, i32 0, i32 %shl
  ret i32 %sel
}
=>
define i32 @bit_floor_32(i32 %x) {
%0:
  %eq0 = icmp eq i32 %x, 0
  %1 = ctlz i32 %x, 0
  %1_range = !range i32 %1, i32 0, i32 33
  %2 = lshr exact i32 2147483648, %1_range
  %sel = select i1 %eq0, i32 0, i32 %2
  ret i32 %sel
}
Transformation doesn't verify! (unsound)
ERROR: Target is more poisonous than source

Example:
i32 %x = undef

Source:
i1 %eq0 = #x1 (1)	[based on undef value]
i32 %lshr = #x00000000 (0)	[based on undef value]
i32 %ctlz = #x00000020 (32)
i32 %sub = #x00000000 (0)
i32 %shl = #x00000001 (1)
i32 %sel = #x00000000 (0)

Target:
i1 %eq0 = #x0 (0)
i32 %1 = #x00000020 (32)
i32 %1_range = #x00000020 (32)
i32 %2 = poison
i32 %sel = poison
Source value: #x00000000 (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'
Wrote bitcode to: "/home/nlopes/alive2/build/logs/in_YeFkXrkw_3MXl.bc"


------------------- SMT STATS -------------------
Num queries: 4
Num invalid: 0
Num skips:   0
Num trivial: 13 (76.5%)
Num timeout: 0 (0.0%)
Num errors:  0 (0.0%)
Num SAT:     4 (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/bit_floor.ll

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

 

NOTE: This test would pass if undef didn't exist!

 

<-- Back