[PATCH] D21804: [SystemZ] Implement shouldExtI32* hooks.

Marcin Koƛcielnicki via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 28 11:06:42 PDT 2016


koriakin created this revision.
koriakin added a reviewer: uweigand.
koriakin added a subscriber: llvm-commits.
koriakin set the repository for this revision to rL LLVM.

On SystemZ, i32 parameters corresponding to C-level int or unsigned int
need signext or zeroext attribute, respectively.  Fill the TTI hooks so
that LLVM passes inserting library calls with such parameters know to use
the attribute.

This makes compiler-rt profile testsuite pass on s390x.

Repository:
  rL LLVM

http://reviews.llvm.org/D21804

Files:
  lib/Target/SystemZ/SystemZTargetTransformInfo.h
  test/Instrumentation/InstrProfiling/icall.ll

Index: test/Instrumentation/InstrProfiling/icall.ll
===================================================================
--- test/Instrumentation/InstrProfiling/icall.ll
+++ test/Instrumentation/InstrProfiling/icall.ll
@@ -2,6 +2,7 @@
 
 ; RUN: opt < %s -mtriple=x86_64-apple-macosx10.10.0 -vp-static-alloc=true -instrprof -S | FileCheck %s --check-prefix=STATIC
 ; RUN: opt < %s -mtriple=x86_64-unknown-linux -instrprof -vp-static-alloc=true -S | FileCheck %s --check-prefix=STATIC
+; RUN: opt < %s -mtriple=s390x-unknown-linux -instrprof -vp-static-alloc=true -S | FileCheck %s --check-prefix=STATIC-EXT
 ; RUN: opt < %s -mtriple=x86_64-apple-macosx10.10.0 -vp-static-alloc=false -instrprof -S | FileCheck %s --check-prefix=DYN
 ; RUN: opt < %s -mtriple=x86_64-unknown-linux -instrprof -vp-static-alloc=false -S | FileCheck %s --check-prefix=DYN
 
@@ -29,3 +30,8 @@
 
 ; DYN-NOT: @__profvp_foo
 ; DYN-NOT: @__llvm_prf_vnodes
+; STATIC: call void @__llvm_profile_instrument_target(i64 %3, i8* bitcast ({ i64, i64, i64*, i8*, i8*, i32, [1 x i16] }* @__profd_foo to i8*), i32 0)
+; STATIC-EXT: call void @__llvm_profile_instrument_target(i64 %3, i8* bitcast ({ i64, i64, i64*, i8*, i8*, i32, [1 x i16] }* @__profd_foo to i8*), i32 zeroext 0)
+
+; STATIC: declare void @__llvm_profile_instrument_target(i64, i8*, i32)
+; STATIC-EXT: declare void @__llvm_profile_instrument_target(i64, i8*, i32 zeroext)
Index: lib/Target/SystemZ/SystemZTargetTransformInfo.h
===================================================================
--- lib/Target/SystemZ/SystemZTargetTransformInfo.h
+++ lib/Target/SystemZ/SystemZTargetTransformInfo.h
@@ -59,6 +59,9 @@
   unsigned getRegisterBitWidth(bool Vector);
 
   /// @}
+
+  bool shouldExtI32Param() const { return true; }
+  bool shouldExtI32Result() const { return true; }
 };
 
 } // end namespace llvm


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21804.62114.patch
Type: text/x-patch
Size: 1839 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160628/63f84b3b/attachment.bin>


More information about the llvm-commits mailing list