diff options
author | Sanjoy Das <sanjoy@playingwithpointers.com> | 2016-08-06 02:58:48 +0000 |
---|---|---|
committer | Sanjoy Das <sanjoy@playingwithpointers.com> | 2016-08-06 02:58:48 +0000 |
commit | ba04d3a620fe70bc7b29dd91e0bdfe5158046b47 (patch) | |
tree | 42a20d7f55200277f9dc4824e035f464cd78cb82 /llvm/lib | |
parent | 9a0035d8d218a99e8b76ad63c927a77d26a5d256 (diff) | |
download | bcm5719-llvm-ba04d3a620fe70bc7b29dd91e0bdfe5158046b47.tar.gz bcm5719-llvm-ba04d3a620fe70bc7b29dd91e0bdfe5158046b47.zip |
[InstCombine] Don't coerce non-integral pointers to integers
Reviewers: majnemer
Subscribers: mcrosier, llvm-commits
Differential Revision: https://reviews.llvm.org/D23231
llvm-svn: 277910
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp index 736c95adae1..8dcc6351ac7 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp @@ -475,7 +475,8 @@ static Instruction *combineLoadToOperationType(InstCombiner &IC, LoadInst &LI) { // size is a legal integer type. if (!Ty->isIntegerTy() && Ty->isSized() && DL.isLegalInteger(DL.getTypeStoreSizeInBits(Ty)) && - DL.getTypeStoreSizeInBits(Ty) == DL.getTypeSizeInBits(Ty)) { + DL.getTypeStoreSizeInBits(Ty) == DL.getTypeSizeInBits(Ty) && + !DL.isNonIntegralPointerType(Ty)) { if (std::all_of(LI.user_begin(), LI.user_end(), [&LI](User *U) { auto *SI = dyn_cast<StoreInst>(U); return SI && SI->getPointerOperand() != &LI; |