This patch folds the following pattern:
%arg0 = ... %0 = zexti %arg0 : i1 to i8 %1 = trunci %0 : i8 to i1
into just %arg0.
ergawy on Sat, Mar 27, 3:32 AM.Authored by
Should be valid with sexti as well right?
Your folder does not do that actually. It is just the framework that does not perform such replacement for all folders.
(side note, you could write simply : If the type of trunci's destination does not match zexti's source types, no folding takes place. ; the intermediate type does not matter here)
I removed this part of the commit message to describe the changes introduced more accurately.