Static alloca usually doesn't generate any machine instructions, so it has 0 cost.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
include/llvm/Analysis/TargetTransformInfoImpl.h | ||
---|---|---|
743 ↗ | (On Diff #115325) | 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; |