[PATCH] D49385: [IPSCCP] Run Solve each time we resolved an undef in a function.

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 1 18:15:04 PDT 2019


jdoerfert added inline comments.
Herald added a project: LLVM.


================
Comment at: llvm/trunk/test/Transforms/IPConstantProp/solve-after-each-resolving-undefs-for-function.ll:15
+  ret i32 10
+}
+
----------------
This test seems broken to me:
(1) branching on `undef` is UB (I think).
(2) even if it's not UB, what other than 10 would this function return? Literally looking at the single return statements makes this already clear. So if it returns, it has to be 10.

I'll put a patch with IPConstantProp tests improvements up soon and for this one I have looks sth like this:

```
define internal i32 @testf(i1 %c) #0 { 
entry:
  br i1 %c, label %if.cond, label %if.end
if.cond: 
  br i1 undef, label %if.then, label %if.end
if.then:
  ret i32 99
if.end:
  ret i32 10
}   
```

Let me know what you think.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D49385/new/

https://reviews.llvm.org/D49385





More information about the llvm-commits mailing list