Test Failure: Transforms/SimplifyCFG/extract-cost.ll

Test source: git

Log:

Source: <stdin>

----------------------------------------
define i32 @f(i32 %a, i32 %b) {
%entry:
  %uadd = uadd_overflow {i32, i1, i24} %a, %b
  %cmp = extractvalue {i32, i1, i24} %uadd, 1
  br i1 %cmp, label %return, label %if.end

%if.end:
  %0 = extractvalue {i32, i1, i24} %uadd, 0
  br label %return

%return:
  %retval.0 = phi i32 [ %0, %if.end ], [ 0, %entry ]
  ret i32 %retval.0
}
=>
define i32 @f(i32 %a, i32 %b) {
%entry:
  %uadd = uadd_overflow {i32, i1, i24} %a, %b
  %cmp = extractvalue {i32, i1, i24} %uadd, 1
  %0 = extractvalue {i32, i1, i24} %uadd, 0
  %spec.select = select i1 %cmp, i32 0, i32 %0
  ret i32 %spec.select
}
Transformation seems to be correct!


----------------------------------------
define i1 @PR32078(<4 x i32> %a, <4 x i32> %b) {
%entry:
  %cmp = icmp eq <4 x i32> %a, %b
  %cmp0 = extractelement <4 x i1> %cmp, i32 0
  %cmp1 = extractelement <4 x i1> %cmp, i32 1
  %cmp2 = extractelement <4 x i1> %cmp, i32 2
  %cmp3 = extractelement <4 x i1> %cmp, i32 3
  br i1 %cmp0, label %cmp0_true, label %exit

%cmp0_true:
  br i1 %cmp1, label %cmp1_true, label %exit

%cmp1_true:
  br i1 %cmp2, label %cmp2_true, label %exit

%cmp2_true:
  br label %exit

%exit:
  %r = phi i1 [ 0, %cmp0_true ], [ 0, %cmp1_true ], [ 0, %entry ], [ %cmp3, %cmp2_true ]
  ret i1 %r
}
=>
define i1 @PR32078(<4 x i32> %a, <4 x i32> %b) {
%entry:
  %cmp = icmp eq <4 x i32> %a, %b
  %cmp0 = extractelement <4 x i1> %cmp, i32 0
  %cmp1 = extractelement <4 x i1> %cmp, i32 1
  %cmp2 = extractelement <4 x i1> %cmp, i32 2
  %cmp3 = extractelement <4 x i1> %cmp, i32 3
  %cmp0.not = xor i1 %cmp0, 1
  %cmp1.not = xor i1 %cmp1, 1
  %brmerge = or i1 %cmp0.not, %cmp1.not
  br i1 %brmerge, label %exit, label %cmp1_true

%cmp1_true:
  %spec.select = select i1 %cmp2, i1 %cmp3, i1 0
  ret i1 %spec.select

%exit:
  ret i1 0
}
Transformation doesn't verify!
ERROR: Source is more defined than target

Example:
<4 x i32> %a = < #xffffffff (4294967295, -1), poison, poison, poison >
<4 x i32> %b = < #x00000000 (0), poison, poison, poison >

Source:
<4 x i1> %cmp = < #x0 (0), poison, poison, poison >
i1 %cmp0 = #x0 (0)
i1 %cmp1 = poison
i1 %cmp2 = poison
i1 %cmp3 = poison
i1 %r = #x0 (0)

Target:
<4 x i1> %cmp = < #x0 (0), poison, poison, poison >
i1 %cmp0 = #x0 (0)
i1 %cmp1 = poison
i1 %cmp2 = poison
i1 %cmp3 = poison
i1 %cmp0.not = #x1 (1)
i1 %cmp1.not = poison
i1 %brmerge = poison
i1 %spec.select = poison



------------------- SMT STATS -------------------
Num queries: 12
Num invalid: 0
Num skips:   0
Num trivial: 11 (47.8%)
Num timeout: 0 (0.0%)
Num errors:  0 (0.0%)
Num SAT:     9 (75.0%)
Num UNSAT:   3 (25.0%)
Alive2: Transform doesn't verify; aborting!

stderr:

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

FileCheck error: '<stdin>' is empty.
FileCheck command line:  /home/nlopes/llvm/build/bin/FileCheck /home/nlopes/llvm/llvm/test/Transforms/SimplifyCFG/extract-cost.ll

 

<-- Back