llvm/test/Reduce/Inputs/remove-bbs.py
David Blaikie 99b6a1f72d llvm-reduce: Add pass to reduce basic blocks
Patch by Diego Treviño!

Differential Revision: https://reviews.llvm.org/D66320

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372264 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-18 21:45:05 +00:00

17 lines
322 B
Python
Executable File

import sys
import re
InterestingBBs = 0
input = open(sys.argv[1], "r")
for line in input:
i = line.find(';')
if i >= 0:
line = line[:i]
if line.startswith("interesting") or "%interesting" in line:
InterestingBBs += 1
if InterestingBBs == 6:
sys.exit(0) # interesting!
sys.exit(1) # IR isn't interesting