Static alloca usually doesn't generate any machine instructions, so it has 0 cost.
Details
Details
Diff Detail
Diff Detail
Event Timeline
include/llvm/Analysis/TargetTransformInfoImpl.h | ||
---|---|---|
743 | This needs a comment. Also, I think this is only true for static allocas. Dynamic ones will still have a cost. Maybe this should be: if (auto *A = dyn_cast<AllocaInst>(U)) if (A->isStaticAlloca()) return TTI::TTC_Free; |
This needs a comment. Also, I think this is only true for static allocas. Dynamic ones will still have a cost. Maybe this should be: