[PATCH] D103660: [ScalarEvolution] Fix pointer/int type handling converting select/phi to min/max.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 16 09:04:51 PDT 2021


efriedma added a comment.

> Hm, have you considered doing the coercion check inside getMinusSCEV? If the construct we're trying to outlaw is a subtract of pointers, maybe we should just explicitly do that? (I'm fine with a cleaned up version of this landing, then exploring that if desired.)

I'll thin about it.



================
Comment at: llvm/test/Transforms/IndVarSimplify/pr45835.ll:13
 entry:
-  %cmp = icmp ule i8* %c, getelementptr inbounds (i8, i8* @a, i64 65535)
+  %cmp = icmp ule i8* %c, @a
   %add.ptr = getelementptr inbounds i8, i8* %c, i64 -65535
----------------
reames wrote:
> Can you explain this test change?
The select was getting matched as a umax; the current version of the logic can't handle that.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103660



More information about the llvm-commits mailing list