[PATCH] D26869: [LV] Add flag for ignoring target info
Michael Kuperstein via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 18 15:24:01 PST 2016
mkuper added a comment.
I like this idea, but that's not very surprising since I suggested it. :-)
So another sanity check would be nice.
================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:2092
+ // This is useful for testing to ensure consistent results across targets.
+ TargetTransformInfo *TTI = nullptr;
+ TargetTransformInfo TTIImpl(F.getParent()->getDataLayout());
----------------
Maybe it'll look a bit simpler if we make TTI a reference?
E.g. something like (haven't checked if it compiles :-) )
```
TargetTransformInfo BaseTTI =
TargetTransformInfo(F.getParent()->getDataLayout());
TargetTransformInfo &TTI = BaseTTI;
if (!IgnoreTargetInfo)
TTI = getAnalysis<TargetTransformInfoWrapperPass>().getTTI(F)
```
================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:7454
auto &LI = AM.getResult<LoopAnalysis>(F);
auto &TTI = AM.getResult<TargetIRAnalysis>(F);
auto &DT = AM.getResult<DominatorTreeAnalysis>(F);
----------------
Please also update this to honor IgnoreTargetInfo.
https://reviews.llvm.org/D26869
More information about the llvm-commits
mailing list