Skip to content
Snippets Groups Projects
Commit 2e6e1d3f authored by Prakalp Srivastava's avatar Prakalp Srivastava
Browse files

for sgem visc sh, also required ignoring argmemonly and writeonly attributes...

for sgem visc sh, also required ignoring argmemonly and writeonly attributes in llvm 4.0 to llvm 3.4 conversion
parent 3d19bd73
No related branches found
No related tags found
No related merge requests found
......@@ -3,9 +3,11 @@ import re
regexSourceFile = re.compile(r"^source_filename.*")
regexMetadataLine = re.compile(r"^![0-9].*")
regexGEP = re.compile(r"(?P<prefix>.*)getelementptr(?P<attr>[A-Za-z ]*)? [A-Za-z0-9%\.]*,")
regexGEP = re.compile(r"(?P<prefix>.*)getelementptr(?P<attr>[A-Za-z ]*)? [<0-9 ]*[A-Zx>a-z 0-9%\.]*,")
regexLoad = re.compile(r"(?P<prefix>.*)= load [<0-9 ]*[A-zx> 0-9%\.]*,")
regexFast = re.compile(r"(?P<prefix>.*)fast")
regexWriteOnly = re.compile(r"(?P<prefix>.*)writeonly")
regexArgmemonly = re.compile(r"(?P<prefix>.*)argmemonly")
with open(sys.argv[1], 'r') as file_LLVM_40:
with open(sys.argv[2], "w") as file_LLVM_34:
......@@ -22,4 +24,8 @@ with open(sys.argv[1], 'r') as file_LLVM_40:
newLine = regexLoad.sub("\g<prefix>= load", line)
elif (regexFast.match(line)):
newLine = regexFast.sub("\g<prefix>", line)
elif (regexWriteOnly.match(line)):
newLine = regexWriteOnly.sub("\g<prefix>", line)
elif (regexArgmemonly.match(line)):
newLine = regexArgmemonly.sub("\g<prefix>", line)
file_LLVM_34.write(newLine)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment