Repository navigation
Fixes for lineinfo emission - #7196
Conversation
|
I can confirm that the decref is no longer jumping back to the line of object creation. I used the following code to test the decref DWARF info: @njit(debug=True)
def foo(n):
#gdb()
ar = np.arange(n)
if ar.sum() == 0: # lifetime of ar ends after this line
ret = 2
else:
ret = 3
return ret |
|
@sklam thanks for checking. I've patched the disassembly support here: stuartarchibald@ee91dd8 to include DWARF info in the disassembly CFG. |
078c95d to
5c3d7ae
Compare
|
Cool, i'll try it now |
| themod = self.__module__ | ||
| thecls = type(self).__name__ | ||
| injected_method = f'{themod}.{thecls}.{test_name}' | ||
| cmd = [sys.executable, '-m', 'numba.runtests', injected_method] | ||
| env_copy = os.environ.copy() | ||
| env_copy['SUBPROC_TEST'] = '1' | ||
| env_copy['NUMBA_OPT'] = '0' | ||
| status = subprocess.run(cmd, stdout=subprocess.PIPE, | ||
| stderr=subprocess.PIPE, timeout=60, | ||
| env=env_copy, universal_newlines=True) | ||
| self.assertEqual(status.returncode, 0) | ||
| self.assertIn('OK', status.stderr) | ||
| self.assertTrue('FAIL' not in status.stderr) | ||
| self.assertTrue('ERROR' not in status.stderr) |
There was a problem hiding this comment.
a duplication of
numba/numba/tests/test_parfors.py
Lines 73 to 86 in 0c499bf
we should dedup here or in a immediate follow up PR
| _exec_cond = os.environ.get('SUBPROC_TEST', None) == '1' | ||
| needs_subprocess = unittest.skipUnless(_exec_cond, "needs subprocess harness") |
There was a problem hiding this comment.
There's still a copy of this in test_parfors.py
numba/numba/tests/test_parfors.py
Lines 56 to 57 in 2eacea6
| f'captured stderr: {status.stderr}') | ||
| self.assertEqual(status.returncode, 0, streams) | ||
| self.assertIn('OK', status.stderr) | ||
| self.assertTrue('FAIL' not in status.stderr) |
There was a problem hiding this comment.
| self.assertTrue('FAIL' not in status.stderr) | |
| self.assertNotIn('FAIL', status.stderr) |
| self.assertEqual(status.returncode, 0, streams) | ||
| self.assertIn('OK', status.stderr) | ||
| self.assertTrue('FAIL' not in status.stderr) | ||
| self.assertTrue('ERROR' not in status.stderr) |
There was a problem hiding this comment.
| self.assertTrue('ERROR' not in status.stderr) | |
| self.assertNotIn('ERROR', status.stderr) |
| if line_stripped.startswith('call void @NRT_decref'): | ||
| self.assertRegex(line, r'.*meminfo\.[0-9]+\)$') | ||
| count += 1 | ||
| self.assertTrue(count > 0) # make sure there were some decrefs! |
There was a problem hiding this comment.
| self.assertTrue(count > 0) # make sure there were some decrefs! | |
| self.assertGreater(count, 0) # make sure there were some decrefs! |
| sig = (types.float64[::1],) | ||
| full_ir = self._get_llvmir(foo, sig=sig) | ||
|
|
||
| # make sure decref lines end with `meminfo.<number>)`. |
There was a problem hiding this comment.
| # make sure decref lines end with `meminfo.<number>)`. | |
| # make sure decref lines end with `meminfo.<number>)` without dbg info. |
|
I wonder if we should leave a note about how the tests are sensitive to SSA and lowering behavior such that they may become outdated when those are changed. |
As title.
Good point, I've added one as part of 8f1c198. All other comments should be addressed in there too. Thanks for the review. |
…_refcounted Fixes for lineinfo emission
As title.
Includes: 2d63784 from #7177 as 3631bdb