[PATCH] D15429: Fix bug with FMA Mutate and register classes

hfinkel@anl.gov via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 10 12:07:10 PST 2015


hfinkel added a subscriber: hfinkel.

================
Comment at: lib/Target/PowerPC/PPCVSXFMAMutate.cpp:223
@@ -222,1 +222,3 @@
 
+        // If there isn't a class that fits, we can't perform the transform.
+        if (!MRI.constrainRegClass(KilledProdReg,
----------------
Please specifically mention here that this can happen when there is a mixture of VSX and Altivec instructions, and we need to prevent assigning a virtual register with a VSX register class to an Altivec instruction.

================
Comment at: lib/Target/PowerPC/PPCVSXFMAMutate.cpp:270
@@ -264,4 +269,3 @@
 
-          UseMO.setReg(KilledProdReg);
-          UseMO.setSubReg(KilledProdSubReg);
+          UseMO.substVirtReg(KilledProdReg, KilledProdSubReg, *TRI);
         }
----------------
Is this a drive-by cleanup or part of the fix? If the former, please commit it separately.

================
Comment at: test/CodeGen/PowerPC/fma-mutate-register-constraint.ll:2
@@ +1,3 @@
+; RUN: llc -enable-unsafe-fp-math < %s | FileCheck %s
+; ModuleID = 'bugpoint-reduced-simplified.bc'
+target datalayout = "e-m:e-i64:64-n32:64"
----------------
Remove the ModuleID line.

================
Comment at: test/CodeGen/PowerPC/fma-mutate-register-constraint.ll:92
@@ +91,3 @@
+
+!1 = !{!2, !2, i64 0}
+!2 = !{!"x_S8_R4$2.1.width4.base724", !3}
----------------
Remove any unnecessary metadata.


Repository:
  rL LLVM

http://reviews.llvm.org/D15429





More information about the llvm-commits mailing list