Test source: git
Source: /home/nuno/llvm/llvm/test/Transforms/SimpleLoopUnswitch/trivial-unswitch-freeze-individual-conditions.ll ---------------------------------------- define i32 @need_freeze_of_individual_or_conditions1(i1 %cond1, i1 %cond2, i1 %cond3, i1 %cond4) { %entry: br label %loop.header %loop.header: %or = or i1 %cond2, %cond3 %and1 = and i1 %or, %cond1 %and2 = select i1 %and1, i1 %cond4, i1 0 br i1 %and2, label %loop.latch, label %exit %loop.latch: call void @some_func() br label %loop.header %exit: ret i32 0 } => define i32 @need_freeze_of_individual_or_conditions1(i1 %cond1, i1 %cond2, i1 %cond3, i1 %cond4) { %entry: %cond4.fr = freeze i1 %cond4 %cond1.fr = freeze i1 %cond1 %0 = and i1 %cond4.fr, %cond1.fr br i1 %0, label %entry.split, label %exit.split %entry.split: %cond2.fr = freeze i1 %cond2 %cond3.fr = freeze i1 %cond3 %1 = and i1 %cond2.fr, %cond3.fr br i1 %1, label %entry.split.split, label %exit.split1 %entry.split.split: br label %loop.header %loop.header: %or = or i1 1, 1 %and1 = and i1 %or, 1 %and2 = select i1 %and1, i1 1, i1 0 br i1 %and2, label %loop.latch, label %exit %loop.latch: call void @some_func() br label %loop.header %exit: br label %exit.split1 %exit.split1: br label %exit.split %exit.split: ret i32 0 } Transformation doesn't verify! ERROR: Source and target don't have the same return domain Example: i1 %cond1 = #x1 (1) i1 %cond2 = #x0 (0) i1 %cond3 = #x1 (1) i1 %cond4 = #x1 (1) Source: >> Jump to %loop.header i1 %or = #x1 (1) i1 %and1 = #x1 (1) i1 %and2 = #x1 (1) >> Jump to %loop.latch void = UB triggered! SOURCE MEMORY STATE =================== NON-LOCAL BLOCKS: Block 0 > size: 0 align: 1 alloc type: 0 Block 1 > size: 0 align: 1 Target: i1 %cond4.fr = #x1 (1) i1 %cond1.fr = #x1 (1) i1 %0 = #x1 (1) >> Jump to %entry.split i1 %cond2.fr = #x0 (0) i1 %cond3.fr = #x1 (1) i1 %1 = #x0 (0) >> Jump to %exit.split1 >> Jump to %exit.split ------------------- SMT STATS ------------------- Num queries: 5 Num invalid: 0 Num skips: 0 Num trivial: 13 (72.2%) Num timeout: 0 (0.0%) Num errors: 0 (0.0%) Num SAT: 4 (80.0%) Num UNSAT: 1 (20.0%) Alive2: Transform doesn't verify; aborting!
+ : 'RUN: at line 2' + /home/nuno/llvm/build/bin/FileCheck /home/nuno/llvm/llvm/test/Transforms/SimpleLoopUnswitch/trivial-unswitch-freeze-individual-conditions.ll + /home/nuno/alive2/build/opt-alive.sh '-passes=loop(simple-loop-unswitch)' -S /home/nuno/llvm/llvm/test/Transforms/SimpleLoopUnswitch/trivial-unswitch-freeze-individual-conditions.ll FileCheck error: '<stdin>' is empty. FileCheck command line: /home/nuno/llvm/build/bin/FileCheck /home/nuno/llvm/llvm/test/Transforms/SimpleLoopUnswitch/trivial-unswitch-freeze-individual-conditions.ll