Skip to content

Commit 64265eb

Browse files
committed
Add global opt pass to remove dead store to global.
1 parent 7f971fa commit 64265eb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

clang/lib/CodeGen/BackendUtil.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
#include "llvm/Transforms/ObjCARC.h"
8484
#include "llvm/Transforms/Scalar/EarlyCSE.h"
8585
#include "llvm/Transforms/Scalar/GVN.h"
86+
#include "llvm/Transforms/IPO/GlobalOpt.h"
8687
#include "llvm/Transforms/Scalar/JumpThreading.h"
8788
#include "llvm/Transforms/Utils/Debugify.h"
8889
#include "llvm/Transforms/Utils/ModuleUtils.h"
@@ -1168,6 +1169,7 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
11681169
if (LangOpts.HLSL) {
11691170
// HLSL legalization passes
11701171
MPM.addPass(DXILFinalizeLinkage());
1172+
MPM.addPass(GlobalOptPass());
11711173
}
11721174

11731175
// Now that we have all of the passes ready, run them.

0 commit comments

Comments
 (0)