Test Failure: Transforms/InstCombine/bcmp-1.ll

Test source: git

Comments: LLVM bug: load type punning. needs byte type

Log:

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

----------------------------------------
define i32 @test_simplify1(ptr %mem, i32 %size) {
%0:
  %ret = bcmp ptr %mem, ptr %mem, i32 %size
  ret i32 %ret
}
Transformation seems to be correct! (syntactically equal)

-- 3. InstCombinePass

----------------------------------------
define i32 @test_simplify1(ptr %mem, i32 %size) {
%0:
  %ret = bcmp ptr %mem, ptr %mem, i32 %size
  ret i32 %ret
}
=>
define i32 @test_simplify1(ptr %mem, i32 %size) {
%0:
  ret i32 0
}
Transformation seems to be correct!

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

----------------------------------------
define i32 @test_simplify2(ptr %mem1, ptr %mem2) {
%0:
  %ret = bcmp ptr %mem1, ptr %mem2, i32 0
  ret i32 %ret
}
Transformation seems to be correct! (syntactically equal)

-- 7. InstCombinePass

----------------------------------------
define i32 @test_simplify2(ptr %mem1, ptr %mem2) {
%0:
  %ret = bcmp ptr %mem1, ptr %mem2, i32 0
  ret i32 %ret
}
=>
define i32 @test_simplify2(ptr %mem1, ptr %mem2) {
%0:
  ret i32 0
}
Transformation seems to be correct!

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

----------------------------------------
define i32 @test_simplify3(ptr %mem1, ptr %mem2) {
%0:
  %ret = bcmp ptr %mem1, ptr %mem2, i32 1
  ret i32 %ret
}
Transformation seems to be correct! (syntactically equal)

-- 11. InstCombinePass

----------------------------------------
define i32 @test_simplify3(ptr %mem1, ptr %mem2) {
%0:
  %ret = bcmp ptr %mem1, ptr %mem2, i32 1
  ret i32 %ret
}
=>
define i32 @test_simplify3(ptr %mem1, ptr %mem2) {
%0:
  %lhsc = load i8, ptr %mem1, align 1
  %lhsv = zext i8 %lhsc to i32
  %rhsc = load i8, ptr %mem2, align 1
  %rhsv = zext i8 %rhsc to i32
  %chardiff = sub nsw i32 %lhsv, %rhsv
  ret i32 %chardiff
}
Transformation doesn't verify! (unsound)
ERROR: Target is more poisonous than source

Example:
ptr %mem1 = pointer(non-local, block_id=1, offset=0)
ptr %mem2 = pointer(non-local, block_id=1, offset=0)

Source:
i32 %ret = #x00000000 (0)

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

Target:
i8 %lhsc = poison
i32 %lhsv = poison
i8 %rhsc = poison
i32 %rhsv = poison
i32 %chardiff = 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' '-mtriple=x86_64-unknown-linux-gnu' '-S' '-tv-smt-to=20000' '-tv-report-dir=/home/nlopes/alive2/build/logs' '-tv-smt-stats'


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

stderr:

+ : 'RUN: at line 4'
+ /home/nlopes/alive2/build/opt-alive.sh -passes=instcombine -mtriple=x86_64-unknown-linux-gnu -S
+ /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/InstCombine/bcmp-1.ll

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

 

<-- Back