Test Failure: Transforms/SimplifyCFG/SimplifyEqualityComparisonWithOnlyPredecessor-domtree-preservation-edgecase.ll

Test source: git

Log:

Source: <stdin>

----------------------------------------
define i32 @lex(i1 %c0, i1 %c1, i32 %r0, i32 %r1, i32 %v) {
%entry:
  br i1 %c0, label %if.end, label %if.then

%if.then:
  ret i32 %r0

%if.end:
  br i1 %c1, label %do.body, label %do.end

%do.body:
  call void @zzz()
  switch i32 %v, label %do.end [
    i32 10, label %if.then193
    i32 32, label %do.body
    i32 9, label %do.body
  ]

%if.then193:
  switch i32 %v, label %do.end [
    i32 32, label %do.body
    i32 10, label %do.body
    i32 9, label %do.body
  ]

%do.end:
  ret i32 %r1
}
=>
define i32 @lex(i1 %c0, i1 %c1, i32 %r0, i32 %r1, i32 %v) {
%entry:
  %c0.not = xor i1 %c0, 1
  %c1.not = xor i1 %c1, 1
  %brmerge = or i1 %c0.not, %c1.not
  %r0.mux = select i1 %c0.not, i32 %r0, i32 %r1
  br i1 %brmerge, label %if.then, label %do.body

%do.body:
  call void @zzz()
  switch i32 %v, label %if.then [
    i32 10, label %do.body
    i32 32, label %do.body
    i32 9, label %do.body
  ]

%if.then:
  %merge = phi i32 [ %r0.mux, %entry ], [ %r1, %do.body ]
  ret i32 %merge
}
Transformation doesn't verify!
ERROR: Source is more defined than target

Example:
i1 %c0 = #x0 (0)
i1 %c1 = poison
i32 %r0 = poison
i32 %r1 = poison
i32 %v = poison

Source:

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

Target:
i1 %c0.not = #x1 (1)
i1 %c1.not = poison
i1 %brmerge = poison
i32 %r0.mux = poison
i32 %merge = poison



------------------- SMT STATS -------------------
Num queries: 2
Num invalid: 0
Num skips:   0
Num trivial: 0 (0.0%)
Num timeout: 0 (0.0%)
Num errors:  0 (0.0%)
Num SAT:     2 (100.0%)
Num UNSAT:   0 (0.0%)

stderr:

+ : 'RUN: at line 2'
+ /home/nlopes/alive2/build/opt-alive.sh -S -simplifycfg -simplifycfg-require-and-preserve-domtree=1
+ /home/nlopes/llvm/build/bin/FileCheck /home/nlopes/llvm/llvm/test/Transforms/SimplifyCFG/SimplifyEqualityComparisonWithOnlyPredecessor-domtree-preservation-edgecase.ll

Alive2: Transform doesn't verify; aborting!
FileCheck error: '<stdin>' is empty.
FileCheck command line:  /home/nlopes/llvm/build/bin/FileCheck /home/nlopes/llvm/llvm/test/Transforms/SimplifyCFG/SimplifyEqualityComparisonWithOnlyPredecessor-domtree-preservation-edgecase.ll

 

<-- Back