forked from OSchip/llvm-project
Fix AffineExpr printing bug: paren ellision b/117887365.
PiperOrigin-RevId: 217803621
This commit is contained in:
parent
03b48999b6
commit
a55b2c2eb6
|
@ -723,7 +723,11 @@ void ModulePrinter::printAffineExprInternal(
|
|||
if (rrhs.getValue() == -1) {
|
||||
printAffineExprInternal(binOp.getLHS(), BindingStrength::Weak);
|
||||
os << " - ";
|
||||
printAffineExprInternal(rhs.getLHS(), BindingStrength::Weak);
|
||||
if (rhs.getLHS().getKind() == AffineExprKind::Add) {
|
||||
printAffineExprInternal(rhs.getLHS(), BindingStrength::Strong);
|
||||
} else {
|
||||
printAffineExprInternal(rhs.getLHS(), BindingStrength::Weak);
|
||||
}
|
||||
|
||||
if (enclosingTightness == BindingStrength::Strong)
|
||||
os << ')';
|
||||
|
|
|
@ -175,6 +175,10 @@
|
|||
// CHECK: #map{{[0-9]+}} = (d0) -> (-2, 1, -1)
|
||||
#map51 = (i) -> (-5 floordiv 3, -5 mod 3, -5 ceildiv 3)
|
||||
|
||||
// Parenthesis ellision.
|
||||
// CHECK: #map{{[0-9]+}} = (d0) -> (d0 * 16 - (d0 + 1) + 15)
|
||||
#map52 = (d0) -> (16*d0 + ((d0 + 1) * -1) + 15)
|
||||
|
||||
// CHECK: extfunc @f0(memref<2x4xi8, #map{{[0-9]+}}, 1>)
|
||||
extfunc @f0(memref<2x4xi8, #map0, 1>)
|
||||
|
||||
|
@ -345,3 +349,6 @@ extfunc @f50(memref<100x100xi8, #map50>)
|
|||
|
||||
// CHECK: extfunc @f51(memref<1xi8, #map{{[0-9]+}}>)
|
||||
extfunc @f51(memref<1xi8, #map51>)
|
||||
|
||||
// CHECK: extfunc @f52(memref<1xi8, #map{{[0-9]+}}>)
|
||||
extfunc @f52(memref<1xi8, #map52>)
|
||||
|
|
Loading…
Reference in New Issue