File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -1632,6 +1632,14 @@ bool TrivialLocalMemoryOpsElimination::runOnFunction(Function& F)
16321632{
16331633 bool change = false ;
16341634
1635+ IGCMD::MetaDataUtils* pMdUtil = getAnalysis<MetaDataUtilsWrapper>().getMetaDataUtils ();
1636+ if (!isEntryFunc (pMdUtil, &F))
1637+ {
1638+ // Skip if it is non-entry function. For example, a subroutine
1639+ // foo ( local int* p) { ...... store v, p; ......}
1640+ // in which no localMemoptimization will be performed.
1641+ return change;
1642+ }
16351643
16361644 visit (F);
16371645 if (!abortPass && (m_LocalLoadsToRemove.empty () ^ m_LocalStoresToRemove.empty ()))
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2626
2727#pragma once
2828#include " Compiler/CodeGenContextWrapper.hpp"
29+ #include " Compiler/MetaDataUtilsWrapper.h"
2930#include " common/MDFrameWork.h"
3031#include " common/LLVMWarningsPush.hpp"
3132#include " llvm/Config/llvm-config.h"
@@ -124,6 +125,7 @@ namespace IGC
124125 virtual void getAnalysisUsage (llvm::AnalysisUsage& AU) const override
125126 {
126127 AU.addRequired <CodeGenContextWrapper>();
128+ AU.addRequired <MetaDataUtilsWrapper>();
127129 AU.setPreservesCFG ();
128130 }
129131
You can’t perform that action at this time.
0 commit comments