Skip to content

Commit

Permalink
Remove some calls to getPointerElementType in TypeAnalysis.cpp (r…
Browse files Browse the repository at this point in the history
…ust-lang#862)

see rust-lang#687

Co-authored-by: William Moses <gh@wsmoses.com>
  • Loading branch information
thewilsonator and wsmoses authored Sep 29, 2022
1 parent ae3e1e3 commit aac3fb2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions enzyme/Enzyme/TypeAnalysis/TypeAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1164,7 +1164,7 @@ void TypeAnalyzer::visitConstantExpr(ConstantExpr &CE) {
int maxSize = -1;
if (cast<ConstantInt>(CE.getOperand(1))->getLimitedValue() == 0) {
maxSize =
DL.getTypeAllocSizeInBits(g2->getType()->getPointerElementType()) / 8;
DL.getTypeAllocSizeInBits(g2->getResultElementType()) / 8;
}

delete g2;
Expand Down Expand Up @@ -1479,7 +1479,7 @@ void TypeAnalyzer::visitGetElementPtrInst(GetElementPtrInst &gep) {
int maxSize = -1;
if (cast<ConstantInt>(vec[0])->getLimitedValue() == 0) {
maxSize =
DL.getTypeAllocSizeInBits(gep.getType()->getPointerElementType()) / 8;
DL.getTypeAllocSizeInBits(gep.getResultElementType()) / 8;
}

if (direction & DOWN) {
Expand Down

0 comments on commit aac3fb2

Please sign in to comment.