summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp
diff options
context:
space:
mode:
authorAlex Shlyapnikov <alekseys@google.com>2017-09-29 22:04:45 +0000
committerAlex Shlyapnikov <alekseys@google.com>2017-09-29 22:04:45 +0000
commite76aa3b0b26333f4e3f0631a7e2ef260cb2f91d1 (patch)
tree12bff21e8c1d9d68cfb3d1401e463b97438f6484 /llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp
parent4f81cdd818b9695380772c20c22d0e2206bbb2e0 (diff)
downloadbcm5719-llvm-e76aa3b0b26333f4e3f0631a7e2ef260cb2f91d1.tar.gz
bcm5719-llvm-e76aa3b0b26333f4e3f0631a7e2ef260cb2f91d1.zip
Revert "Use the basic cost if a GEP is not used as addressing mode"
This reverts commit r314517. This commit crashes sanitizer bots, for example: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/4167 Stack snippet: ... /mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/include/llvm/Support/Casting.h:255:0 llvm::TargetTransformInfoImplCRTPBase<llvm::X86TTIImpl>::getGEPCost(llvm::GEPOperator const*, llvm::ArrayRef<llvm::Value const*>) /mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h:742:0 llvm::TargetTransformInfoImplCRTPBase<llvm::X86TTIImpl>::getUserCost(llvm::User const*, llvm::ArrayRef<llvm::Value const*>) /mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h:782:0 /mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/lib/Analysis/TargetTransformInfo.cpp:116:0 /mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/include/llvm/ADT/SmallVector.h:116:0 /mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/include/llvm/ADT/SmallVector.h:343:0 /mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/include/llvm/ADT/SmallVector.h:864:0 /mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/include/llvm/Analysis/TargetTransformInfo.h:285:0 ... llvm-svn: 314560
Diffstat (limited to 'llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp
index 3f93eaecc5d..8b8d6590aa6 100644
--- a/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp
+++ b/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp
@@ -239,7 +239,7 @@ static bool isGEPFoldable(GetElementPtrInst *GEP,
SmallVector<const Value*, 4> Indices;
for (auto I = GEP->idx_begin(); I != GEP->idx_end(); ++I)
Indices.push_back(*I);
- return TTI->getGEPCost(cast<GEPOperator>(GEP),
+ return TTI->getGEPCost(GEP->getSourceElementType(), GEP->getPointerOperand(),
Indices) == TargetTransformInfo::TCC_Free;
}
OpenPOWER on IntegriCloud