[PATCH] D17250: [Polly] [Refactor] Enable llvm's isa/cast/dyn_cast on MemAccInst

Hongbin Zheng via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 26 09:13:19 PST 2016


etherzhhb added inline comments.

================
Comment at: lib/Analysis/ScopInfo.cpp:619
@@ -618,5 +618,3 @@
 void MemoryAccess::buildMemIntrinsicAccessRelation() {
-  auto MAI = MemAccInst(getAccessInstruction());
-  (void)MAI;
-  assert(MAI.isMemIntrinsic());
+  assert(isa<MemIntrinsic>(MemAccInst(getAccessInstruction())));
   assert(Subscripts.size() == 2 && Sizes.size() == 0);
----------------
Meinersbur wrote:
> etherzhhb wrote:
> > Meinersbur wrote:
> > > Does this work was well?
> > > ```
> > > assert(isa<MemIntrinsic>(getAccessInstruction()));
> > > ```
> > if getAccessInstruction() return nullptr.
> > 
> > 
> > ```
> > assert(isa<MemIntrinsic>(MemAccInst(getAccessInstruction())));
> > ```
> > Trigger an assertion failure.
> > 
> > 
> > ```
> > assert(isa<MemIntrinsic>(getAccessInstruction()));
> > ```
> > 
> > Trigger a SIGSEGV (suppose to ... no sure)
> > 
> > 
> > Maybe we should write:
> > ```
> > assert(getAccessInstruction() && isa<MemIntrinsic>(getAccessInstruction()));```
> isa<XYZ*>(nullptr) triggers the following assertion:
> ```
> assert(Val && "isa<> used on a null pointer");
> ```
> in llvm/Support/Casting.h:81/88/95/102
ok


Repository:
  rL LLVM

http://reviews.llvm.org/D17250





More information about the llvm-commits mailing list