Test Failure: Transforms/InstCombine/memset.ll

Test source: git

Comments: LLVM bug: removes store undef

Log:

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

----------------------------------------
define i32 @test(ptr %target) {
#0:
  memset ptr %target align 1, i8 1, i32 0
  memset ptr %target align 1, i8 1, i32 1
  memset ptr %target align 2, i8 1, i32 2
  memset ptr %target align 4, i8 1, i32 4
  memset ptr %target align 8, i8 1, i32 8
  ret i32 0
}
Transformation seems to be correct! (syntactically equal)

-- 3. InstCombinePass

----------------------------------------
define i32 @test(ptr %target) {
#0:
  memset ptr %target align 1, i8 1, i32 0
  memset ptr %target align 1, i8 1, i32 1
  memset ptr %target align 2, i8 1, i32 2
  memset ptr %target align 4, i8 1, i32 4
  memset ptr %target align 8, i8 1, i32 8
  ret i32 0
}
=>
define i32 @test(ptr %target) {
#0:
  store i8 1, ptr %target, align 1
  store i16 257, ptr %target, align 2
  store i32 16843009, ptr %target, align 4
  store i64 72340172838076673, ptr %target, align 8
  ret i32 0
}
Transformation seems to be correct!

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

----------------------------------------
@Unknown = constant 16 bytes, align 4

define void @memset_to_constant() {
#0:
  memset ptr @Unknown align 1, i8 0, i32 16
  ret void
}
Transformation seems to be correct! (syntactically equal)

-- 7. InstCombinePass

----------------------------------------
@Unknown = constant 16 bytes, align 4

define void @memset_to_constant() {
#0:
  memset ptr @Unknown align 4, i8 0, i32 16
  ret void
}
=>
@Unknown = constant 16 bytes, align 4

define void @memset_to_constant() {
#0:
  ret void
}

****************************************
WARNING: Source function is always UB.
It can be refined by any target function.
Please make sure this is what you wanted.
****************************************

Transformation seems to be correct!

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

----------------------------------------
define void @memset_undef(ptr %p) {
#0:
  memset ptr %p align 1, i8 undef, i32 8
  ret void
}
Transformation seems to be correct! (syntactically equal)

-- 11. InstCombinePass

----------------------------------------
define void @memset_undef(ptr %p) {
#0:
  memset ptr %p align 1, i8 undef, i32 8
  ret void
}
=>
define void @memset_undef(ptr %p) {
#0:
  ret void
}
Transformation doesn't verify! (unsound)
ERROR: Mismatch in memory

Example:
ptr %p = pointer(non-local, block_id=1, offset=0) / Address=#x01

Source:

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

Target:

Mismatch in pointer(non-local, block_id=1, offset=0)
Source value: #x00
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_HepOKzXe_MLcY.bc"


------------------- SMT STATS -------------------
Num queries: 26
Num invalid: 0
Num skips:   0
Num trivial: 18 (40.9%)
Num timeout: 0 (0.0%)
Num errors:  0 (0.0%)
Num SAT:     15 (57.7%)
Num UNSAT:   11 (42.3%)
Alive2: Transform doesn't verify; aborting!

stderr:

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

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

 

<-- Back