[PATCH] D43323: [NFC] Consolidate six getPointerOperand() utility functions into one place

Hideki Saito via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 16 14:41:27 PST 2018


hsaito added a comment.

Looks like this is applicable to Polly also.

Polly ScopHelper.h
MemAccInst::getPointerOperand()

  llvm::Value *getPointerOperand() const { 
    if (isLoad())
      return asLoad()->getPointerOperand();
    if (isStore())
      return asStore()->getPointerOperand();
    if (isMemIntrinsic()) 
      return asMemIntrinsic()->getRawDest();
    if (isCallInst())
      return nullptr;
    llvm_unreachable("Operation not supported on nullptr"); 
  } 


https://reviews.llvm.org/D43323





More information about the llvm-commits mailing list