[PATCH] D29631: SystemZTargetTransformInfo cost functions and some common code changes

Ulrich Weigand via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 22 08:41:19 PST 2017


uweigand added a comment.

See inline comments.

The new test cases look good to me, thanks!



================
Comment at: lib/Target/SystemZ/SystemZTargetTransformInfo.cpp:343
+        Opcode == Instruction::AShr || Opcode == Instruction::Or) {
+      return NumVectors;
+    }
----------------
jonpa wrote:
> uweigand wrote:
> > Shouldn't we have And and Xor here as well?
> No - And and Xor are 'Legal', while the ones handled here are 'Custom'. Only for 'Custom' is this needed, since the default implementation then assumes it is twice as expensive, while it is actually not on z13.
I see.  However, for vector types, Or is also marked as "Legal" -- only for scalar i64 is it Custom.


================
Comment at: lib/Target/SystemZ/SystemZTargetTransformInfo.cpp:770
+    NumOps *= 2;
+
+  return  NumOps;
----------------
The original code in getUnrollingPreferences also used 2 for 128-bit integer types.  Should this be done now here as well?


https://reviews.llvm.org/D29631





More information about the llvm-commits mailing list