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

Jonas Paulsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 22 23:40:15 PST 2017


jonpa added inline comments.


================
Comment at: lib/Target/SystemZ/SystemZTargetTransformInfo.cpp:343
+        Opcode == Instruction::AShr || Opcode == Instruction::Or) {
+      return NumVectors;
+    }
----------------
uweigand wrote:
> 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.
Ahh, thanks. Removed Or.


================
Comment at: lib/Target/SystemZ/SystemZTargetTransformInfo.cpp:770
+    NumOps *= 2;
+
+  return  NumOps;
----------------
uweigand wrote:
> The original code in getUnrollingPreferences also used 2 for 128-bit integer types.  Should this be done now here as well?
That's never seen by the LoopVectorizer, but I think you are right that it should be handled here since it's actually handled by the backend. Thanks.

Changed to check for scalars of 128 bits.



https://reviews.llvm.org/D29631





More information about the llvm-commits mailing list