[llvm] r177152 - Protect PPC Altivec patterns with a predicate

Hal Finkel hfinkel at anl.gov
Fri Mar 15 06:21:21 PDT 2013


Author: hfinkel
Date: Fri Mar 15 08:21:21 2013
New Revision: 177152

URL: http://llvm.org/viewvc/llvm-project?rev=177152&view=rev
Log:
Protect PPC Altivec patterns with a predicate

In preparation for the addition of other SIMD ISA extensions (such as QPX) we
need to make sure that all Altivec patterns are properly predicated on having
Altivec support.

No functionality change intended (one test case needed to be updated b/c it
assumed that Altivec intrinsics would be supported without enabling Altivec
support).

Modified:
    llvm/trunk/lib/Target/PowerPC/PPCInstrAltivec.td
    llvm/trunk/test/CodeGen/PowerPC/2007-09-04-AltivecDST.ll

Modified: llvm/trunk/lib/Target/PowerPC/PPCInstrAltivec.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCInstrAltivec.td?rev=177152&r1=177151&r2=177152&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCInstrAltivec.td (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCInstrAltivec.td Fri Mar 15 08:21:21 2013
@@ -182,6 +182,9 @@ class VX2_Int<bits<11> xo, string opc, I
 //===----------------------------------------------------------------------===//
 // Instruction Definitions.
 
+def HasAltivec : Predicate<"PPCSubTarget.hasAltivec()">;
+let Predicates = [HasAltivec] in {
+
 def DSS      : DSS_Form<822, (outs),
                         (ins u5imm:$ZERO0, u5imm:$STRM,u5imm:$ZERO1,u5imm:$ZERO2),
                         "dss $STRM", LdStLoad /*FIXME*/, []>;
@@ -733,3 +736,6 @@ def : Pat<(v4f32 (ftrunc (v4f32 VRRC:$vA
           (VRFIZ VRRC:$vA)>;
 def : Pat<(v4f32 (fnearbyint (v4f32 VRRC:$vA))),
           (VRFIN VRRC:$vA)>;
+
+} // end HasAltivec
+

Modified: llvm/trunk/test/CodeGen/PowerPC/2007-09-04-AltivecDST.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/2007-09-04-AltivecDST.ll?rev=177152&r1=177151&r2=177152&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/PowerPC/2007-09-04-AltivecDST.ll (original)
+++ llvm/trunk/test/CodeGen/PowerPC/2007-09-04-AltivecDST.ll Fri Mar 15 08:21:21 2013
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=ppc64 | grep dst | count 4
+; RUN: llc < %s -march=ppc64 -mattr=+altivec | grep dst | count 4
 
 define hidden void @_Z4borkPc(i8* %image) {
 entry:





More information about the llvm-commits mailing list