[llvm] r185840 - PPC: Mark vector FREM as Expand by default

Hal Finkel hfinkel at anl.gov
Mon Jul 8 10:30:25 PDT 2013


Author: hfinkel
Date: Mon Jul  8 12:30:25 2013
New Revision: 185840

URL: http://llvm.org/viewvc/llvm-project?rev=185840&view=rev
Log:
PPC: Mark vector FREM as Expand by default

Another bug found by llvm-stress! This fixes crashing with:
  LLVM ERROR: Cannot select: v4f32 = frem ...

Modified:
    llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp
    llvm/trunk/test/CodeGen/PowerPC/vector.ll

Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=185840&r1=185839&r2=185840&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Mon Jul  8 12:30:25 2013
@@ -392,6 +392,7 @@ PPCTargetLowering::PPCTargetLowering(PPC
       setOperationAction(ISD::UDIV, VT, Expand);
       setOperationAction(ISD::UREM, VT, Expand);
       setOperationAction(ISD::FDIV, VT, Expand);
+      setOperationAction(ISD::FREM, VT, Expand);
       setOperationAction(ISD::FNEG, VT, Expand);
       setOperationAction(ISD::FSQRT, VT, Expand);
       setOperationAction(ISD::FLOG, VT, Expand);

Modified: llvm/trunk/test/CodeGen/PowerPC/vector.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/vector.ll?rev=185840&r1=185839&r2=185840&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/PowerPC/vector.ll (original)
+++ llvm/trunk/test/CodeGen/PowerPC/vector.ll Mon Jul  8 12:30:25 2013
@@ -59,6 +59,14 @@ define void @test_div(%f8* %P, %f8* %Q,
         ret void
 }
 
+define void @test_rem(%f8* %P, %f8* %Q, %f8* %S) {
+        %p = load %f8* %P               ; <%f8> [#uses=1]
+        %q = load %f8* %Q               ; <%f8> [#uses=1]
+        %R = frem %f8 %p, %q            ; <%f8> [#uses=1]
+        store %f8 %R, %f8* %S
+        ret void
+}
+
 ;;; TEST VECTOR CONSTRUCTS
 
 define void @test_cst(%f4* %P, %f4* %S) {





More information about the llvm-commits mailing list