@@ -64,10 +64,10 @@ struct VectorInfo;
64
64
struct InterleavedLoadCombineImpl {
65
65
public:
66
66
InterleavedLoadCombineImpl (Function &F, DominatorTree &DT, MemorySSA &MSSA,
67
+ const TargetTransformInfo &TTI,
67
68
const TargetMachine &TM)
68
69
: F(F), DT(DT), MSSA(MSSA),
69
- TLI (*TM.getSubtargetImpl(F)->getTargetLowering()),
70
- TTI(TM.getTargetTransformInfo(F)) {}
70
+ TLI (*TM.getSubtargetImpl(F)->getTargetLowering()), TTI(TTI) {}
71
71
72
72
// / Scan the function for interleaved load candidates and execute the
73
73
// / replacement if applicable.
@@ -87,7 +87,7 @@ struct InterleavedLoadCombineImpl {
87
87
const TargetLowering &TLI;
88
88
89
89
// / Target Transform Information
90
- const TargetTransformInfo TTI;
90
+ const TargetTransformInfo & TTI;
91
91
92
92
// / Find the instruction in sets LIs that dominates all others, return nullptr
93
93
// / if there is none.
@@ -1329,13 +1329,15 @@ struct InterleavedLoadCombine : public FunctionPass {
1329
1329
return InterleavedLoadCombineImpl (
1330
1330
F, getAnalysis<DominatorTreeWrapperPass>().getDomTree (),
1331
1331
getAnalysis<MemorySSAWrapperPass>().getMSSA (),
1332
+ getAnalysis<TargetTransformInfoWrapperPass>().getTTI (F),
1332
1333
TPC->getTM <TargetMachine>())
1333
1334
.run ();
1334
1335
}
1335
1336
1336
1337
void getAnalysisUsage (AnalysisUsage &AU) const override {
1337
1338
AU.addRequired <MemorySSAWrapperPass>();
1338
1339
AU.addRequired <DominatorTreeWrapperPass>();
1340
+ AU.addRequired <TargetTransformInfoWrapperPass>();
1339
1341
FunctionPass::getAnalysisUsage (AU);
1340
1342
}
1341
1343
@@ -1348,7 +1350,8 @@ InterleavedLoadCombinePass::run(Function &F, FunctionAnalysisManager &FAM) {
1348
1350
1349
1351
auto &DT = FAM.getResult <DominatorTreeAnalysis>(F);
1350
1352
auto &MemSSA = FAM.getResult <MemorySSAAnalysis>(F).getMSSA ();
1351
- bool Changed = InterleavedLoadCombineImpl (F, DT, MemSSA, *TM).run ();
1353
+ auto &TTI = FAM.getResult <TargetIRAnalysis>(F);
1354
+ bool Changed = InterleavedLoadCombineImpl (F, DT, MemSSA, TTI, *TM).run ();
1352
1355
return Changed ? PreservedAnalyses::none () : PreservedAnalyses::all ();
1353
1356
}
1354
1357
@@ -1360,6 +1363,7 @@ INITIALIZE_PASS_BEGIN(
1360
1363
false , false )
1361
1364
INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
1362
1365
INITIALIZE_PASS_DEPENDENCY(MemorySSAWrapperPass)
1366
+ INITIALIZE_PASS_DEPENDENCY(TargetTransformInfoWrapperPass)
1363
1367
INITIALIZE_PASS_END(
1364
1368
InterleavedLoadCombine, DEBUG_TYPE,
1365
1369
" Combine interleaved loads into wide loads and shufflevector instructions" ,
0 commit comments