File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
llvm/lib/Transforms/Vectorize Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -1811,6 +1811,10 @@ bool VectorCombine::scalarizeLoadExtract(Instruction &I) {
18111811 // erased in the correct order.
18121812 Worklist.push (LI);
18131813
1814+ LLVMContext &ctx = LI->getContext ();
1815+ unsigned aliasScopeKind = ctx.getMDKindID (" alias.scope" );
1816+ unsigned noAliasKind = ctx.getMDKindID (" noalias" );
1817+
18141818 // Replace extracts with narrow scalar loads.
18151819 for (User *U : LI->users ()) {
18161820 auto *EI = cast<ExtractElementInst>(U);
@@ -1831,6 +1835,14 @@ bool VectorCombine::scalarizeLoadExtract(Instruction &I) {
18311835 LI->getAlign (), VecTy->getElementType (), Idx, *DL);
18321836 NewLoad->setAlignment (ScalarOpAlignment);
18331837
1838+ if (MDNode *aliasScope = LI->getMetadata (aliasScopeKind)) {
1839+ NewLoad->setMetadata (aliasScopeKind, aliasScope);
1840+ }
1841+
1842+ if (MDNode *noAlias = LI->getMetadata (noAliasKind)) {
1843+ NewLoad->setMetadata (noAliasKind, noAlias);
1844+ }
1845+
18341846 replaceValue (*EI, *NewLoad);
18351847 }
18361848
You can’t perform that action at this time.
0 commit comments