gollvm: sync with LLVM trunk

Changes to sync with LLVM trunk at svn rev 371610 (new signature
for getTLI()).

Change-Id: I8f625fe429911f8b309c92a2bbdee566bbafee8a
Reviewed-on: https://go-review.googlesource.com/c/gollvm/+/194678
Reviewed-by: Cherry Zhang <cherryyz@google.com>
diff --git a/passes/GoStatepoints.cpp b/passes/GoStatepoints.cpp
index 1a3a0e4..9b272b9 100644
--- a/passes/GoStatepoints.cpp
+++ b/passes/GoStatepoints.cpp
@@ -181,8 +181,6 @@
                        GO_FUNC_SYM);
 
     bool Changed = false;
-    const TargetLibraryInfo &TLI =
-        getAnalysis<TargetLibraryInfoWrapperPass>().getTLI();
     for (Function &F : M) {
       // Nothing to do for declarations.
       if (F.isDeclaration() || F.empty())
@@ -193,6 +191,9 @@
       if (!shouldRewriteStatepointsIn(F))
         continue;
 
+      const TargetLibraryInfo &TLI =
+          getAnalysis<TargetLibraryInfoWrapperPass>().getTLI(F);
+
       TargetTransformInfo &TTI =
           getAnalysis<TargetTransformInfoWrapperPass>().getTTI(F);
       auto &DT = getAnalysis<DominatorTreeWrapperPass>(F).getDomTree();