def _compile_and_test(self, fn, arg_tys, asserts=None, equivs=None, idempotent=True):
        """
        Compile the given function and get its IR.
        """
        if asserts is None:
            asserts = []
        if equivs is None:
            equivs = []
        test_pipeline = ArrayAnalysisTester.mk_pipeline(arg_tys)
        test_idempotence = self.compare_ir if idempotent else lambda x:()
        analysis = test_pipeline.compile_to_ir(fn, test_idempotence)
        if equivs:
            for func in equivs:
                # only test the equiv_set of the first block
                func(analysis.equiv_sets[0])
        if asserts is None:
            self.assertTrue(self._has_no_assertcall(analysis.func_ir))
        else:
            for func in asserts:
                func(analysis.func_ir, analysis.typemap)

        Compile the given function and get its IR.
        
numba/tests/test_array_analysis.py