Closed
Description
module @patterns {
pdl.pattern : benefit(1) {
%0 = pdl.type
%1 = pdl.type
%2 = pdl.operand : %0
%3 = pdl.operand : %1
%4 = operation "foo"(%2, %3 : !pdl.value, !pdl.value) -> (%1 : !pdl.type)
pdl.rewrite %4 {
pdl.erase %4
}
}
}
cse's to
module @patterns {
pdl.pattern : benefit(1) {
%0 = type
%1 = operand : %0
%2 = operation "foo"(%1, %1 : !pdl.value, !pdl.value) -> (%0 : !pdl.type)
rewrite %2 {
erase %2
}
}
}
which forces the match into filtering only ops "foo" with operands of the same type.
Adding side effects to, at least, ops that implicitly captures from the environment should help.