Unverified Commit a0c1b5bd authored by DianQK's avatar DianQK
Browse files

Reland "[SimplifyCFG] Check if the return instruction causes undefined behavior"

This relands commit b6a0be8c.

Return undefined to a noundef return value is undefined.

Example:

```
define noundef i32 @test_ret_noundef(i1 %cond) {
entry:
  br i1 %cond, label %bb1, label %bb2
bb1:
  br label %bb2
bb2:
  %r = phi i32 [ undef, %entry ], [ 1, %bb1 ]
  ret i32 %r
}
```
parent 6384b623
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment