[PATCH] D21805: [PowerPC] Implement shouldExtI32* hooks.

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


koriakin created this revision.
koriakin added a reviewer: hfinkel.
koriakin added a subscriber: llvm-commits.
koriakin set the repository for this revision to rL LLVM.
Herald added subscribers: nemanjai, amehsan.

On PowerPC64, 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.


Repository:
  rL LLVM

http://reviews.llvm.org/D21805

Files:
  lib/Target/PowerPC/PPCTargetTransformInfo.h
  test/Instrumentation/InstrProfiling/icall.ll

Index: test/Instrumentation/InstrProfiling/icall.ll
===================================================================
--- test/Instrumentation/InstrProfiling/icall.ll
+++ test/Instrumentation/InstrProfiling/icall.ll
@@ -2,7 +2,9 @@
 
 ; 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=powerpc-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=powerpc64-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
 
Index: lib/Target/PowerPC/PPCTargetTransformInfo.h
===================================================================
--- lib/Target/PowerPC/PPCTargetTransformInfo.h
+++ lib/Target/PowerPC/PPCTargetTransformInfo.h
@@ -92,6 +92,9 @@
                                  unsigned AddressSpace);
 
   /// @}
+
+  bool shouldExtI32Param() const { return ST->isPPC64(); }
+  bool shouldExtI32Result() const { return ST->isPPC64(); }
 };
 
 } // end namespace llvm


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21805.62115.patch
Type: text/x-patch
Size: 1554 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160628/1cffd069/attachment.bin>


More information about the llvm-commits mailing list