This patch folds the following pattern:
%arg0 = ... %0 = zexti %arg0 : i1 to i8 %1 = trunci %0 : i8 to i1
into just %arg0.
Differential D99453
[MLIR][STD] Fold trunci (zexti). ergawy on Mar 27 2021, 3:32 AM. Authored by
Details
This patch folds the following pattern: %arg0 = ... %0 = zexti %arg0 : i1 to i8 %1 = trunci %0 : i8 to i1 into just %arg0.
Diff Detail
Event TimelineComment Actions I came across this pattern while working on detensoring in linalg-on-tensors for IREE. Let me know if there are any reasons why this might be a bad idea. Comment Actions 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)
Comment Actions
I removed this part of the commit message to describe the changes introduced more accurately.
|
Can you add a one line comment: trunci(zexti(a)) -> a