1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
2 ; RUN: opt -S -passes=indvars < %s | FileCheck %s
4 target datalayout = "n8:16:32:64"
6 ; Just make sure this doesn't crash.
7 ; SCEVExpander produces a degenerate phi node for the widened IV here,
8 ; where the "increment" instruction folds to a poison value.
10 ; CHECK-LABEL: define i32 @main() {
12 ; CHECK-NEXT: br label [[LOOP:%.*]]
14 ; CHECK-NEXT: br label [[LOOP]]
18 %trunc = trunc i32 %div to i16
22 %phi = phi i16 [ 0, %entry ], [ %or, %loop ]
23 %or = or disjoint i16 %phi, %trunc
24 %phi.ext = sext i16 %phi to i64
25 %add.ptr = getelementptr i8, ptr null, i64 %phi.ext