@@ -12781,7 +12781,7 @@ struct AAAddressSpaceCallSiteArgument final : AAAddressSpaceImpl {
1278112781} // namespace
1278212782
1278312783// / ------------------------ No Alias Address Space ---------------------------
12784- // This attrubte assumes flat address space can alias all other address space
12784+ // This attribute assumes flat address space can alias all other address space
1278512785namespace {
1278612786struct AANoAliasAddrSpaceImpl : public AANoAliasAddrSpace {
1278712787 AANoAliasAddrSpaceImpl (const IRPosition &IRP, Attributor &A)
@@ -12848,6 +12848,8 @@ struct AANoAliasAddrSpaceImpl : public AANoAliasAddrSpace {
1284812848 MDNode *NoAliasASNode = nullptr ;
1284912849 MDBuilder MDB (Ctx);
1285012850 for (RangeMap::const_iterator I = Map.begin (); I != Map.end (); I++) {
12851+ if (I.value () != true )
12852+ continue ;
1285112853 unsigned Upper = I.stop ();
1285212854 unsigned Lower = I.start ();
1285312855 if (NoAliasASNode == nullptr ) {
@@ -12861,7 +12863,7 @@ struct AANoAliasAddrSpaceImpl : public AANoAliasAddrSpace {
1286112863 Value *AssociatedValue = &getAssociatedValue ();
1286212864 bool Changed = false ;
1286312865
12864- auto Pred = [&](const Use &U, bool &) {
12866+ auto AddNoAliasAttr = [&](const Use &U, bool &) {
1286512867 if (U.get () != AssociatedValue)
1286612868 return true ;
1286712869 auto *Inst = dyn_cast<Instruction>(U.getUser ());
@@ -12876,8 +12878,8 @@ struct AANoAliasAddrSpaceImpl : public AANoAliasAddrSpace {
1287612878 Changed = true ;
1287712879 return true ;
1287812880 };
12879- (void )A.checkForAllUses (Pred , *this , getAssociatedValue (),
12880- /* CheckBBLivenessOnly=*/ true );
12881+ (void )A.checkForAllUses (AddNoAliasAttr , *this , getAssociatedValue (),
12882+ /* CheckBBLivenessOnly=*/ true );
1288112883 return Changed ? ChangeStatus::CHANGED : ChangeStatus::UNCHANGED;
1288212884 }
1288312885
0 commit comments