diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2014-05-29 23:21:12 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2014-05-29 23:21:12 +0000 |
commit | fdc0e0b47830aa6fd16eecfab2c6dc8357b8b03c (patch) | |
tree | f944abf85c96819b5d3c5e9338fdea58fc482da3 /llvm/lib/Transforms | |
parent | efe09b4c651e1bc9b1502f5f18050b3164f03cf3 (diff) | |
download | bcm5719-llvm-fdc0e0b47830aa6fd16eecfab2c6dc8357b8b03c.tar.gz bcm5719-llvm-fdc0e0b47830aa6fd16eecfab2c6dc8357b8b03c.zip |
And fix my fix to sink down through the type at the right time. My
original fix would actually trigger the *exact* same crasher as the
original bug for a different reason. Awesomesauce.
Working on test cases now, but wanted to get bots healthier.
llvm-svn: 209860
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstructionCombining.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp index 38f92ddf665..9b8fdb27002 100644 --- a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp +++ b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp @@ -1240,14 +1240,6 @@ Instruction *InstCombiner::visitGetElementPtrInst(GetElementPtrInst &GEP) { if (Op1->getOperand(J)->getType() != Op2->getOperand(J)->getType()) return nullptr; - if (J > 1) { - if (CompositeType *CT = dyn_cast<CompositeType>(CurTy)) { - CurTy = CT->getTypeAtIndex(Op1->getOperand(J)); - } else { - CurTy = nullptr; - } - } - if (Op1->getOperand(J) != Op2->getOperand(J)) { if (DI == -1) { // We have not seen any differences yet in the GEPs feeding the @@ -1270,6 +1262,15 @@ Instruction *InstCombiner::visitGetElementPtrInst(GetElementPtrInst &GEP) { return nullptr; } } + + // Sink down a layer of the type for the next iteration. + if (J > 0) { + if (CompositeType *CT = dyn_cast<CompositeType>(CurTy)) { + CurTy = CT->getTypeAtIndex(Op1->getOperand(J)); + } else { + CurTy = nullptr; + } + } } } |