[llvm-commits] PATCH: Add support for tracking pairs of pointers with a constant offset to inline cost estimation

Duncan Sands baldrick at free.fr
Tue Mar 13 01:23:15 PDT 2012


Hi Chandler,

On 13/03/12 01:47, Chandler Carruth wrote:
> Updated patch with a basic test. I'd love to hear ideas for more thorough
> testing of this feature.

+      // There are two instructions which produce a strict constant value when
+      // applied to two related pointer values. Ignore everything else.
+      if (!isa<ICmpInst>(I) && I->getOpcode() != Instruction::Sub)
+        continue;
+      assert(I->getNumOperands() == 2);

maybe I'm missing something, but are all compares really guaranteed to produce a
constant result here?

Ciao, Duncan.



More information about the llvm-commits mailing list