[llvm-commits] [llvm] r144580 - in /llvm/trunk: include/llvm/Analysis/CaptureTracking.h include/llvm/Analysis/MemoryDependenceAnalysis.h lib/Analysis/CaptureTracking.cpp lib/Analysis/MemoryDependenceAnalysis.cpp test/Transforms/GVN/rle.ll

Chris Lattner clattner at apple.com
Tue Nov 15 16:40:19 PST 2011


On Nov 14, 2011, at 2:49 PM, Nick Lewycky wrote:

> Author: nicholas
> Date: Mon Nov 14 16:49:42 2011
> New Revision: 144580
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=144580&view=rev
> Log:
> Refactor capture tracking (which already had a couple flags for whether returns
> and stores capture) to permit the caller to see each capture point and decide
> whether to continue looking.
> 
> Use this inside memdep to do an analysis that basicaa won't do. This lets us
> solve another devirtualization case, fixing PR8908!

Awesome, thanks for fixing this! but...
> +++ llvm/trunk/include/llvm/Analysis/CaptureTracking.h Mon Nov 14 16:49:42 2011
> @@ -14,9 +14,14 @@
> #ifndef LLVM_ANALYSIS_CAPTURETRACKING_H
> #define LLVM_ANALYSIS_CAPTURETRACKING_H
> 
> -namespace llvm {
> -  class Value;
> +#include "llvm/Constants.h"
> +#include "llvm/Instructions.h"
> +#include "llvm/Analysis/AliasAnalysis.h"
> +#include "llvm/ADT/SmallSet.h"
> +#include "llvm/ADT/SmallVector.h"
> +#include "llvm/Support/CallSite.h"

Eww, gross.  Why not make PointerMayBeCaptured a virtual interface instead of templatizing this like crazy?  This would also turn your giant comment block into actual code :) and allow the simple implementation to be used by default.

-Chris





More information about the llvm-commits mailing list