[LLVMdev] new methods for ScalarEvolutions

Preston Briggs
Mon, 09 Apr 2012 16:15:49 -0000

Working on a dependence test, I wrote some code that looked like this:

  const SCEV *delta = ...;
  bool deltaMaybeZero     = !SE->isKnownNonZero(delta);
  bool deltaMaybePositive = !SE->isKnownNonPositive(delta);
  bool deltaMaybeNegative = !SE->isKnownNonNegative(delta);

I'm really happy with the power of the SCEVs, letting me answer these
questions, but I'm unhappy with how the code reads, namely the double
negatives.

Perhaps we might introduce a handful of new methods, things like

  *bool ScalarEvolution::isPerhapsZero(const SCEV *S) {*
*    return !isKnownNonZero(S);*
*  }*

Seem useful?

Preston
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20120409/3403e9ac/attachment.html>