[ValueTracking] Use Instruction::getFunction; NFC
authorSanjoy Das <sanjoy@playingwithpointers.com>
Thu, 14 Jul 2016 20:19:01 +0000 (20:19 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Thu, 14 Jul 2016 20:19:01 +0000 (20:19 +0000)
llvm-svn: 275465

llvm/lib/Analysis/ValueTracking.cpp

index 3277c3c..f2b4078 100644 (file)
@@ -3107,11 +3107,9 @@ bool llvm::isSafeToSpeculativelyExecute(const Value *V,
     const LoadInst *LI = cast<LoadInst>(Inst);
     if (!LI->isUnordered() ||
         // Speculative load may create a race that did not exist in the source.
-        LI->getParent()->getParent()->hasFnAttribute(
-            Attribute::SanitizeThread) ||
+        LI->getFunction()->hasFnAttribute(Attribute::SanitizeThread) ||
         // Speculative load may load data from dirty regions.
-        LI->getParent()->getParent()->hasFnAttribute(
-            Attribute::SanitizeAddress))
+        LI->getFunction()->hasFnAttribute(Attribute::SanitizeAddress))
       return false;
     const DataLayout &DL = LI->getModule()->getDataLayout();
     return isDereferenceableAndAlignedPointer(LI->getPointerOperand(),