Test Failure: Transforms/LICM/PR116813-memoryssa-outdated.ll

Test source: git

Log:

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

----------------------------------------
declare i32 @bar() nofree willreturn memory(none)

@bar = constant ? bytes, exec, align 8

define i32 @foo(i1 %arg, ptr %arg1) {
start:
  br label %loop

loop:
  %i = select i1 %arg, ptr %arg1, ptr @bar
  %i3 = call i32 %i()
  br i1 %arg, label %loop, label %ret

ret:
  ret i32 %i3
}
Transformation seems to be correct! (syntactically equal)

-- 3. PassManager<Function> : Skipping NOP
-- 4. LoopSimplifyPass

----------------------------------------
declare i32 @bar() nofree willreturn memory(none)

@bar = constant ? bytes, exec, align 8

define i32 @foo(i1 %arg, ptr %arg1) {
start:
  br label %loop

loop:
  %i = select i1 %arg, ptr %arg1, ptr @bar
  %i3 = call i32 %i()
  br i1 %arg, label %loop, label %ret

ret:
  ret i32 %i3
}
Transformation seems to be correct! (syntactically equal)

-- 5. LoopSimplifyPass

----------------------------------------
declare i32 @bar() nofree willreturn memory(none)

@bar = constant ? bytes, exec, align 8

define i32 @foo(i1 %arg, ptr %arg1) {
start:
  br label %loop

loop:
  %i = select i1 %arg, ptr %arg1, ptr @bar
  %i3 = call i32 %i()
  br i1 %arg, label %loop, label %ret

ret:
  ret i32 %i3
}
Transformation seems to be correct! (syntactically equal)

-- 6. LCSSAPass

----------------------------------------
declare i32 @bar() nofree willreturn memory(none)

@bar = constant ? bytes, exec, align 8

define i32 @foo(i1 %arg, ptr %arg1) {
start:
  br label %loop

loop:
  %i = select i1 %arg, ptr %arg1, ptr @bar
  %i3 = call i32 %i()
  br i1 %arg, label %loop, label %ret

ret:
  ret i32 %i3
}
Transformation seems to be correct! (syntactically equal)

-- 7. LCSSAPass

----------------------------------------
declare i32 @bar() nofree willreturn memory(none)

@bar = constant ? bytes, exec, align 8

define i32 @foo(i1 %arg, ptr %arg1) {
start:
  br label %loop

loop:
  %i = select i1 %arg, ptr %arg1, ptr @bar
  %i3 = call i32 %i()
  br i1 %arg, label %loop, label %ret

ret:
  ret i32 %i3
}
=>
declare i32 @bar() nofree willreturn memory(none)

@bar = constant ? bytes, exec, align 8

define i32 @foo(i1 %arg, ptr %arg1) {
start:
  br label %loop

loop:
  %i = select i1 %arg, ptr %arg1, ptr @bar
  %i3 = call i32 %i()
  br i1 %arg, label %loop, label %ret

ret:
  %i3.lcssa = phi i32 [ %i3, %loop ]
  ret i32 %i3.lcssa
}
Transformation seems to be correct!

-- 8. PassManager<Function> : Skipping NOP
-- 9. PassManager<Loop, AnalysisManager<Loop, LoopStandardAnalysisResults&>, LoopStandardAnalysisResults&, LPMUpdater&> : Skipping NOP
-- 10. SimpleLoopUnswitchPass

----------------------------------------
declare i32 @bar() nofree willreturn memory(none)

@bar = constant ? bytes, exec, align 8

define i32 @foo(i1 %arg, ptr %arg1) {
start:
  br label %loop

loop:
  %i = select i1 %arg, ptr %arg1, ptr @bar
  %i3 = call i32 %i()
  br i1 %arg, label %loop, label %ret

ret:
  %i3.lcssa = phi i32 [ %i3, %loop ]
  ret i32 %i3.lcssa
}
Transformation seems to be correct! (syntactically equal)

-- 11. PassManager<Loop, AnalysisManager<Loop, LoopStandardAnalysisResults&>, LoopStandardAnalysisResults&, LPMUpdater&> : Skipping NOP
-- 12. SimpleLoopUnswitchPass

----------------------------------------
declare i32 @bar() nofree willreturn memory(none)

@bar = constant ? bytes, exec, align 8

define i32 @foo(i1 %arg, ptr %arg1) {
start:
  br label %loop

loop:
  %i = select i1 %arg, ptr %arg1, ptr @bar
  %i3 = call i32 %i()
  br i1 %arg, label %loop, label %ret

ret:
  %i3.lcssa = phi i32 [ %i3, %loop ]
  ret i32 %i3.lcssa
}
=>
declare i32 @bar() nofree willreturn memory(none)

@bar = constant ? bytes, exec, align 8

define i32 @foo(i1 %arg, ptr %arg1) {
start:
  %arg.fr = freeze i1 %arg
  br i1 %arg.fr, label %start.split.us, label %start.split

start.split:
  br label %loop

loop:
  br label %#0

#0:
  %i3 = call i32 @bar() nofree willreturn memory(none)
  br i1 0, label %loop, label %ret.split

ret.split:
  %i3.lcssa = phi i32 [ %i3, %#0 ]
  br label %ret

start.split.us:
  br label %loop.us

loop.us:
  br label %#1

#1:
  br label %#2

#2:
  %unswitched.select.us = phi ptr [ %arg1, %#1 ]
  %i3.us = call i32 %unswitched.select.us()
  br i1 1, label %loop.us, label %ret.split.us

ret.split.us:
  %i3.lcssa.us = phi i32 [ %i3.us, %#2 ]
  br label %ret

ret:
  %.us-phi = phi i32 [ %i3.lcssa, %ret.split ], [ %i3.lcssa.us, %ret.split.us ]
  ret i32 %.us-phi
}
Transformation doesn't verify! (unsound)
ERROR: Source is more defined than target

Example:
i1 %arg = #x0 (0)
ptr %arg1 = null

Source:
  >> Jump to %loop
ptr %i = pointer(non-local, block_id=1, offset=0) / Address=#x08
i32 %i3 = function did not return!

SOURCE MEMORY STATE
===================
NON-LOCAL BLOCKS:
Block 0 >	size: 0	align: 1	alloc type: 0	alive: false	address: 0
Block 1 >	size: 4	align: 8	alloc type: 0	alive: true	address: 8	const
Block 2 >	size: 0	align: 1	alloc type: 0	alive: true	address: 7
Block 3 >	size: 0	align: 1	alloc type: 0	alive: true	address: 4
Block 4 >	size: 0	align: 1	alloc type: 0	alive: true	address: 5

Target:
i1 %arg.fr = #x0 (0)
  >> Jump to %start.split
  >> Jump to %loop
  >> Jump to %#0
Function @bar triggered UB


Pass: SimpleLoopUnswitchPass
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=loop-mssa(simple-loop-unswitch<nontrivial>,licm)' '-verify-memoryssa' '-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_HDIz4LNx_p8OT.bc"


------------------- SMT STATS -------------------
Num queries: 47
Num invalid: 0
Num skips:   0
Num trivial: 7 (13.0%)
Num timeout: 0 (0.0%)
Num errors:  0 (0.0%)
Num SAT:     34 (72.3%)
Num UNSAT:   13 (27.7%)
Alive2: Transform doesn't verify; aborting!

stderr:

RUN: at line 2: /home/nlopes/alive2/build/opt-alive.sh -passes='loop-mssa(simple-loop-unswitch<nontrivial>,licm)' -verify-memoryssa -S < /bitbucket/nlopes/llvm/llvm/test/Transforms/LICM/PR116813-memoryssa-outdated.ll | /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/LICM/PR116813-memoryssa-outdated.ll
+ /home/nlopes/alive2/build/opt-alive.sh '-passes=loop-mssa(simple-loop-unswitch<nontrivial>,licm)' -verify-memoryssa -S
+ /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/LICM/PR116813-memoryssa-outdated.ll

FileCheck error: '<stdin>' is empty.
FileCheck command line:  /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/LICM/PR116813-memoryssa-outdated.ll

 

<-- Back