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

Christian Clauss via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 27 14:49:52 PST 2025


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

>From 53e8159b97ee0785a1a756bc4d07097fc641e7be 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 Python 3 SyntaxErrors

---
 polly/utils/jscop2cloog.py       |  2 +-
 polly/utils/pyscop/jscop2iscc.py | 26 ++++++++++++++------------
 2 files changed, 15 insertions(+), 13 deletions(-)

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..7ffccaf2deb1e4 100755
--- a/polly/utils/pyscop/jscop2iscc.py
+++ b/polly/utils/pyscop/jscop2iscc.py
@@ -1,4 +1,6 @@
 #!/usr/bin/env python
+from __future__ import print_function
+
 import argparse, isl, os
 import json
 
@@ -9,8 +11,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 +23,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 +33,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 +43,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 +60,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