mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-08 05:26:07 +00:00

When the single branch target of a block has been removed try updating it to target a block that is kept (by scanning forward in the sequence) instead of replacing the branch with a return instruction. Doing so reduces the risk of breaking loop structures meaning that when the loop is 'interesting' these reductions should have more blocks eliminated. Differential Revision: https://reviews.llvm.org/D125766
16 lines
376 B
Python
Executable File
16 lines
376 B
Python
Executable File
import subprocess
|
|
import sys
|
|
|
|
opt = subprocess.run( [ 'opt', '-passes=print<loops>','-disable-output', sys.argv[1]], stdout=subprocess.PIPE, stderr=subprocess.PIPE )
|
|
|
|
stdout = opt.stdout.decode()
|
|
|
|
pattern = 'Loop at depth 1 containing'
|
|
|
|
if (pattern in opt.stderr.decode()):
|
|
print('This is interesting!')
|
|
sys.exit(0)
|
|
else:
|
|
print('This is NOT interesting!')
|
|
sys.exit(1)
|