Question about addr capture

Shuxin Yang shuxin.llvm at gmail.com
Fri Mar 22 10:56:07 PDT 2013


Hi, list:

      Would someone shed some light on the following code.  How can an 
address be captured via icmp?

Thanks
Shuxin

cat -n lib/Analysis/CaptureTracking.cpp
==========================
157     case Instruction::ICmp:
158       // Don't count comparisons of a no-alias return value against 
null as
159       // captures. This allows us to ignore comparisons of malloc 
results
160       // with null, for example.
161       if (isNoAliasCall(V->stripPointerCasts()))
162         if (ConstantPointerNull *CPN =
163 dyn_cast<ConstantPointerNull>(I->getOperand(1)))
164           if (CPN->getType()->getAddressSpace() == 0)
165             break;
166       // Otherwise, be conservative. There are crazy ways to capture 
pointers
167       // using comparisons.
168       if (Tracker->captured(U))





More information about the llvm-commits mailing list