File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
llvm/test/Transforms/CorrelatedValuePropagation Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -123,3 +123,30 @@ return:
123
123
ret i8* %r
124
124
}
125
125
126
+ ; FIXME:
127
+ ; The sub has 'nsw', so it is not safe to propagate that value along
128
+ ; the bb2 edge because that would propagate poison to the return.
129
+
130
+ define i32 @PR43802 (i32 %arg ) {
131
+ ; CHECK-LABEL: @PR43802(
132
+ ; CHECK-NEXT: entry:
133
+ ; CHECK-NEXT: [[SUB:%.*]] = sub nsw i32 0, [[ARG:%.*]]
134
+ ; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 [[ARG]], -2147483648
135
+ ; CHECK-NEXT: br i1 [[CMP]], label [[BB2:%.*]], label [[BB3:%.*]]
136
+ ; CHECK: bb2:
137
+ ; CHECK-NEXT: br label [[BB3]]
138
+ ; CHECK: bb3:
139
+ ; CHECK-NEXT: ret i32 [[SUB]]
140
+ ;
141
+ entry:
142
+ %sub = sub nsw i32 0 , %arg
143
+ %cmp = icmp eq i32 %arg , -2147483648
144
+ br i1 %cmp , label %bb2 , label %bb3
145
+
146
+ bb2:
147
+ br label %bb3
148
+
149
+ bb3:
150
+ %r = phi i32 [ -2147483648 , %bb2 ], [ %sub , %entry ]
151
+ ret i32 %r
152
+ }
You can’t perform that action at this time.
0 commit comments