[polly] r256650 - IslExprBuilder: Provide PointerLikeTypeTraits for isl_id
Tobias Grosser via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 30 12:11:49 PST 2015
Author: grosser
Date: Wed Dec 30 14:11:48 2015
New Revision: 256650
URL: http://llvm.org/viewvc/llvm-project?rev=256650&view=rev
Log:
IslExprBuilder: Provide PointerLikeTypeTraits for isl_id
Providing an explicit PointerLikeTypeTraits implementation became necessary
since LLVM started in https://llvm.org/svn/llvm-project/llvm/trunk@256620
to automatically derive the pointer alignment from the pointer element type,
which does not work for incomplete types as used by isl. To ensure our code
still compiles, we provide an instantiation of PointerLikeTypeTraits for isl_id
which assumes no minimal alignment. isl pointers are likely to have a "higher"
alignment. We can exploit this later in case this becomes performance relevant.
Modified:
polly/trunk/include/polly/CodeGen/IslExprBuilder.h
Modified: polly/trunk/include/polly/CodeGen/IslExprBuilder.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/CodeGen/IslExprBuilder.h?rev=256650&r1=256649&r2=256650&view=diff
==============================================================================
--- polly/trunk/include/polly/CodeGen/IslExprBuilder.h (original)
+++ polly/trunk/include/polly/CodeGen/IslExprBuilder.h Wed Dec 30 14:11:48 2015
@@ -23,6 +23,21 @@ class DataLayout;
class ScalarEvolution;
}
+struct isl_id;
+
+namespace llvm {
+// Provide PointerLikeTypeTraits for isl_id.
+template <> class PointerLikeTypeTraits<isl_id *> {
+
+public:
+ static inline const void *getAsVoidPointer(isl_id *P) { return (void *)P; }
+ static inline const Region *getFromVoidPointer(void *P) {
+ return (Region *)P;
+ }
+ enum { NumLowBitsAvailable = 0 };
+};
+}
+
namespace polly {
/// @brief LLVM-IR generator for isl_ast_expr[essions]
More information about the llvm-commits
mailing list