[PATCH] D25464: [NFC] Loop Versioning for LICM code clean up

Ashutosh Nema via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 12 22:08:19 PDT 2016


ashutosh.nema added a comment.

Changes looks OK, except one minor formatting comment.



================
Comment at: lib/Transforms/Scalar/LoopVersioningLICM.cpp:305
-    DEBUG(dbgs() << "    Alias tracker type safety failed!\n");
-    return false;
   }
----------------
eastig wrote:
> sbaranga wrote:
> > eastig wrote:
> > > It's strange checking. It was questioned in https://reviews.llvm.org/D9151. An answer was: 
> > > 
> > > > Actually this is a pre-condition in LICM’s “promoteLoopAccessesToScalars” where it expects all pointers in alias should have same type.
> > > > To confirm same behaviour we added this check.
> > > 
> > > Yes, type checking is needed for AliasSet when all pointers must alias. This is done by LICM. In case of AliasSet whose pointers may alias we can have aliased pointers of different types, e.g. char * and char ** which might be aliased and they have different types.
> > I agree, this does look strange (and it might not be a NFC), I think either Ashutosh or Adam should comment on this.
> I'll revert for this review.
Type check is required for LICM, it expects pointers in the alias set should have the same type.


================
Comment at: lib/Transforms/Scalar/LoopVersioningLICM.cpp:166
   LoopVersioningLICM()
-      : LoopPass(ID), AA(nullptr), SE(nullptr), LI(nullptr), DT(nullptr),
-        TLI(nullptr), LAA(nullptr), LAI(nullptr), Changed(false),
-        Preheader(nullptr), CurLoop(nullptr), CurAST(nullptr),
+      : LoopPass(ID), AA(nullptr), SE(nullptr),
+        LAA(nullptr), LAI(nullptr),
----------------
Please correct formatting, can use clang-format here.


https://reviews.llvm.org/D25464





More information about the llvm-commits mailing list