[PATCH] LoopStrengthReduce: Try to pass address space to isLegalAddressingMode

hfinkel at anl.gov hfinkel at anl.gov
Mon Jun 22 17:07:20 PDT 2015


Would it be better to do this refactoring by making some pair<Type *, AddressSpace> and passing that around instead of adding the extra AddressSpace parameter everywhere? If the underlying premise is that the Type is meaningless without the address space, I'd prefer to just force them to live together.


================
Comment at: lib/Transforms/Scalar/LoopStrengthReduce.cpp:3188
@@ -3152,1 +3187,3 @@
+        std::pair<size_t, int64_t> P = getUse(S, LSRUse::Basic,
+                                              nullptr, ~0u);
         LF.LUIdx = P.first;
----------------
I'd rather not end up with code like this. It would be better to define some global constant InvalidAddressSpace (or similar) that is equal to ~0u, and then use that.

http://reviews.llvm.org/D10289

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list