'Trigger the compiler on the core function or load a previously
compiled version from the cache.  Returns the CompileResult.'

def _compile_core(self, sig, flags, locals):

    typingctx = self.targetdescr.typing_context
    targetctx = self.targetdescr.target_context
    @contextmanager
    def store_overloads_on_success():
        try:
            (yield)
        except:
            raise
        else:
            exists = self.overloads.get(cres.signature)
            if (exists is None):
                self.overloads[cres.signature] = cres
    with compiler.lock_compiler:
        with store_overloads_on_success():
            cres = self.cache.load_overload(sig, targetctx)
            if (cres is not None):
                return cres
            (args, return_type) = sigutils.normalize_signature(sig)
            cres = compiler.compile_extra(typingctx, targetctx, self.py_func, args=args, return_type=return_type, flags=flags, locals=locals)
            self.cache.save_overload(sig, cres)
            return cres
