[PATCH] A new HeapToStack allocation promotion pass
Joey Gouly
joey.gouly at arm.com
Tue Sep 24 08:39:46 PDT 2013
> FAddr might not be an instruction, but it probably is. I could write:
>
> if (isa<Instruction>(FAddr) && VerifiedMallocs.count(cast<Instruction>(FAddr))) or even
>
> if (VerifiedMallocs.count(dyn_cast<Instruction>(FAddr)))
> but both of those pessimize the common case. Pointers to non-instruction will never be in the map.
>
> It is just a micro-optimization (which happens to lead to fewer source-code characters). I'm fine with removing it for clarity.
Does it actually make any noticeable difference?
I personally prefer the use of dyn_cast, but I won't push too hard for it.
http://llvm-reviews.chandlerc.com/D1745
More information about the llvm-commits
mailing list