[llvm-commits] [PATCH] fold umax(zext A, zext B) -> zext (umax(A, B))

Török Edwin edwintorok at gmail.com
Wed Jun 17 11:35:49 PDT 2009


Hi,

I noticed that umax (zext t1 %X to %t0, zext t1 %Y to %t0) isn't folded,
the attached patch folds this into:
umax (zext t1 %X to %t0, zext t1 %Y to %t0).

It also folds umax (sext t1 %X to %t0, sext t1 %Y to %t0) ->  sext t1
(umax (%X, %Y)) to %t0.

zext is very often encountered in SCEV expressions on x86-64, since
pointer indexes for GEP are i64.

Thoughts?

Best regards,
--Edwin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scev.patch
Type: text/x-diff
Size: 1980 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20090617/b4449434/attachment.patch>


More information about the llvm-commits mailing list