[polly] polly: Fix three Python files that contain SyntaxErrors (PR #124424)

Christian Clauss via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 25 11:32:36 PST 2025


https://github.com/cclauss created https://github.com/llvm/llvm-project/pull/124424

These changes were originally in:
*  #123940

They are moved here to enable a focused review by `polly` authors: @tobiasgrosser, @Meinersbur

>From e0556a0cba3eb97cef531895ed5d740c8cf52765 Mon Sep 17 00:00:00 2001
From: Christian Clauss <cclauss at me.com>
Date: Sat, 25 Jan 2025 20:27:04 +0100
Subject: [PATCH] polly: Fix three Python files that contain SyntaxErrors

---
 .../External/isl/imath/tools/findthreshold.py |  6 ++---
 polly/utils/jscop2cloog.py                    |  2 +-
 polly/utils/pyscop/jscop2iscc.py              | 24 +++++++++----------
 3 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/polly/lib/External/isl/imath/tools/findthreshold.py b/polly/lib/External/isl/imath/tools/findthreshold.py
index fbb325e1da916a..0971c862f987e5 100644
--- a/polly/lib/External/isl/imath/tools/findthreshold.py
+++ b/polly/lib/External/isl/imath/tools/findthreshold.py
@@ -86,9 +86,9 @@ def compute_stats():
     stats = compute_stats()
     stats.sort(key=lambda s: s[3] / s[2])
     for prec, thresh, trec, tnorm in stats:
-        print "%d\t%d\t%.3f\t%.3f\t%.4f" % (prec, thresh, trec, tnorm,
-                                            tnorm / trec)
+        print("%d\t%d\t%.3f\t%.3f\t%.4f" % (prec, thresh, trec, tnorm,
+                                            tnorm / trec))
 
-    print
+    print()
 
 # Here there be dragons
diff --git a/polly/utils/jscop2cloog.py b/polly/utils/jscop2cloog.py
index 29383974f26780..1d8a31047d1164 100755
--- a/polly/utils/jscop2cloog.py
+++ b/polly/utils/jscop2cloog.py
@@ -50,7 +50,7 @@ def writeCloog(scop):
   context = scop['context']
   domains = getDomains(scop)
   schedules = getSchedules(scop)
-  print template % (context, domains, schedules)
+  print(template % (context, domains, schedules))
 
 def __main__():
   description = 'Translate JSCoP into iscc input'
diff --git a/polly/utils/pyscop/jscop2iscc.py b/polly/utils/pyscop/jscop2iscc.py
index 42f4cc180f1fb9..2ab27538d8632b 100755
--- a/polly/utils/pyscop/jscop2iscc.py
+++ b/polly/utils/pyscop/jscop2iscc.py
@@ -9,8 +9,8 @@ def printDomain(scop):
   for statement in scop['statements']:
     domain = domain.union(isl.USet(statement['domain']))
 
-  print "D :=",
-  print str(domain) + ";"
+  print("D :=", end=" ")
+  print(str(domain) + ";")
 
 def printAccesses(scop):
 
@@ -21,8 +21,8 @@ def printAccesses(scop):
       if access['kind'] == 'read':
         read = read.union(isl.UMap(access['relation']))
 
-  print "R :=",
-  print str(read) + ";"
+  print("R :=", end=" ")
+  print(str(read) + ";")
 
   write = isl.UMap('{}')
 
@@ -31,8 +31,8 @@ def printAccesses(scop):
       if access['kind'] == 'write':
         write = write.union(isl.UMap(access['relation']))
 
-  print "W :=",
-  print str(write) + ";"
+  print("W :=", end=" ")
+  print(str(write) + ";")
 
 def printSchedule(scop):
 
@@ -41,8 +41,8 @@ def printSchedule(scop):
   for statement in scop['statements']:
     schedule = schedule.union(isl.UMap(statement['schedule']))
 
-  print "S :=",
-  print str(schedule) + ";"
+  print("S :=", end=" ")
+  print(str(schedule) + ";")
 
 def __main__():
   description = 'Translate JSCoP into iscc input'
@@ -58,10 +58,10 @@ def __main__():
   printAccesses(scop)
   printSchedule(scop)
 
-  print 'R := R * D;'
-  print 'W := W * D;'
-  print 'Dep := (last W before R under S)[0];'
-  print 'schedule D respecting Dep minimizing Dep;'
+  print('R := R * D;')
+  print('W := W * D;')
+  print('Dep := (last W before R under S)[0];')
+  print('schedule D respecting Dep minimizing Dep;')
 
 
 __main__()



More information about the llvm-commits mailing list