On Aug 1, 2007, at 6:18 PM, Christopher Lamb wrote:
> Author: clamb
> Teach BasicAA about noalias parameter attributes, but do it
> correctly this time.
Nice! One minor style nit-pick:
> if (isa<Argument>(O1)) {
> // Incoming argument cannot alias locally allocated object!
> if (isa<AllocationInst>(O2)) return NoAlias;
> +
> + // If they are two different objects, and one is a noalias
> argument
> + // then they do not alias.
> + if (O1 != O2 && isNoAliasArgument(cast<Argument>(O1)))
> + return NoAlias;
Instead of using isa + cast, please use dyncast:
if (const Argument *O1Arg = dyn_cast<Argument>(O1)) {
// Incoming argument cannot alias locally allocated object!
if (isa<AllocationInst>(O2)) return NoAlias;
+
+ // If they are two different objects, and one is a noalias
argument
+ // then they do not alias.
+ if (O1 != O2 && isNoAliasArgument(O1Arg))
+ return NoAlias;
Thanks Christopher,
-Chris
_______________________________________________
llvm-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits