[PATCH] D37051: Model cache size and associativity in TargetTransformInfo

Tobias Grosser via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 24 00:41:18 PDT 2017


grosser marked 2 inline comments as done.
grosser added a comment.

Addressed Alex comments.



================
Comment at: include/llvm/Analysis/TargetTransformInfoImpl.h:348
+    case TargetTransformInfo::CL_L2D:
+      return llvm::Optional<unsigned>();
+    }
----------------
asb wrote:
> Shouldn't this have something like:
> ````
> default:
>   llvm_unreachable("Unknown TargetTransformInfo::CacheLevel")
> ```
The switch above is fully covered, but I can add this as a form of defensive programming. Thinking about this, it might also be useful to used typed enums for the cache level. I will update the patch accordingly.


https://reviews.llvm.org/D37051





More information about the llvm-commits mailing list