xref: /aosp_15_r20/external/llvm/test/CodeGen/Hexagon/early-if-phi-i1.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s
2*9880d681SAndroid Build Coastguard Worker; REQUIRES: asserts
3*9880d681SAndroid Build Coastguard Worker; Check that the early if-conversion does not predicate block1 (where the
4*9880d681SAndroid Build Coastguard Worker; join block has a phi node of type i1).
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Workerdefine i1 @foo(i32 %x, i32* %p) {
7*9880d681SAndroid Build Coastguard Workerentry:
8*9880d681SAndroid Build Coastguard Worker  %c = icmp sgt i32 %x, 0
9*9880d681SAndroid Build Coastguard Worker  %c1 = icmp sgt i32 %x, 10
10*9880d681SAndroid Build Coastguard Worker  br i1 %c, label %block2, label %block1
11*9880d681SAndroid Build Coastguard Workerblock1:
12*9880d681SAndroid Build Coastguard Worker  store i32 1, i32* %p, align 4
13*9880d681SAndroid Build Coastguard Worker  br label %block2
14*9880d681SAndroid Build Coastguard Workerblock2:
15*9880d681SAndroid Build Coastguard Worker  %b = phi i1 [ 0, %entry ], [ %c1, %block1 ]
16*9880d681SAndroid Build Coastguard Worker  ret i1 %b
17*9880d681SAndroid Build Coastguard Worker}
18