[PATCH] D43762: [IPSCCP] Use constant range information for comparisons of parameters.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 22 10:22:35 PDT 2018


fhahn added inline comments.


================
Comment at: test/Transforms/SCCP/ip-constant-ranges.ll:5
 ; CHECK-LABEL: f1
-; CHECK-NOT: icmp
-; CHECK: %a.1 = select i1 false, i32 1, i32 2
-; CHECK: %b.1 = select i1 true, i32 1, i32 2
-; CHECK: %a.2 = select i1 false, i32 1, i32 2
-; CHECK: %b.2 = select i1 true, i32 1, i32 2
+; CHECK: ret i32 undef
 define internal i32 @f1(i32 %a, i32 %b) {
----------------
mssimpso wrote:
> mssimpso wrote:
> > Hi Florian,
> > 
> > I'm not understanding why we end up with `undef` here. Can you help me out?
> Ah, it's because the function becomes dead after the simplification in `@caller1`. Right?
Yep. And the selects are removed, because now the range info is used directly in the solver and is used to simplify the function further.


https://reviews.llvm.org/D43762





More information about the llvm-commits mailing list