[PATCH] D18898: [Loop Rotation] Make default max rotation header size threshold dependent on target CPU
Z. Zheng via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 27 11:21:15 PDT 2016
zzheng added a subscriber: zzheng.
zzheng added a comment.
Minor suggestion to use Optional<unsigned>.
================
Comment at: lib/Transforms/Scalar/LoopRotation.cpp:569
@@ +568,3 @@
+ const TargetTransformInfo *TTI) {
+ if (SpecifiedThreshold == -1)
+ return RotationThreshold.getNumOccurrences() > 0
----------------
```
if (SpecifiedThreshold.hasValue())
return *SpecifiedThreshold;
else {
...
}
```
================
Comment at: lib/Transforms/Scalar/LoopRotation.cpp:584
@@ -571,2 +583,3 @@
static char ID; // Pass ID, replacement for typeid
- LoopRotate(int SpecifiedMaxHeaderSize = -1) : LoopPass(ID) {
+ LoopRotate(int SpecifiedMaxHeaderSize = -1)
+ : LoopPass(ID), SpecifiedThreshold(SpecifiedMaxHeaderSize) {
----------------
Can we take this opportunity to change it to
```
Optional<unsigned> SpecifiedMaxHeaderSize
```
http://reviews.llvm.org/D18898
More information about the llvm-commits
mailing list