[llvm] 529bb8a - [PowerPC] Fix the incorrect 'RM' flag set on load/store instr

QingShan Zhang via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 5 18:48:15 PST 2019


Author: QingShan Zhang
Date: 2019-11-06T02:46:37Z
New Revision: 529bb8a98048302686b7c58e2a62a4223a18e5c2

URL: https://github.com/llvm/llvm-project/commit/529bb8a98048302686b7c58e2a62a4223a18e5c2
DIFF: https://github.com/llvm/llvm-project/commit/529bb8a98048302686b7c58e2a62a4223a18e5c2.diff

LOG: [PowerPC] Fix the incorrect 'RM' flag set on load/store instr

The 'RM' flag model the "Rounding Mode" and it has nothing to do with the load/store instructions.

Differential Revision: https://reviews.llvm.org/D69551

Added: 
    llvm/test/CodeGen/PowerPC/instr-properties.ll

Modified: 
    llvm/lib/Target/PowerPC/PPCInstrVSX.td

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/PowerPC/PPCInstrVSX.td b/llvm/lib/Target/PowerPC/PPCInstrVSX.td
index 750c5d421f45..a2b27cd921e9 100644
--- a/llvm/lib/Target/PowerPC/PPCInstrVSX.td
+++ b/llvm/lib/Target/PowerPC/PPCInstrVSX.td
@@ -152,7 +152,6 @@ def HasOnlySwappingMemOps : Predicate<"!PPCSubTarget->hasP9Vector()">;
 let Predicates = [HasVSX] in {
 let AddedComplexity = 400 in { // Prefer VSX patterns over non-VSX patterns.
 let hasSideEffects = 0 in { // VSX instructions don't have side effects.
-let Uses = [RM] in {
 
   // Load indexed instructions
   let mayLoad = 1, mayStore = 0 in {
@@ -214,6 +213,7 @@ let Uses = [RM] in {
     }
   } // mayStore
 
+  let Uses = [RM] in {
   // Add/Mul Instructions
   let isCommutable = 1 in {
     def XSADDDP : XX3Form<60, 32,

diff  --git a/llvm/test/CodeGen/PowerPC/instr-properties.ll b/llvm/test/CodeGen/PowerPC/instr-properties.ll
new file mode 100644
index 000000000000..8d7115288306
--- /dev/null
+++ b/llvm/test/CodeGen/PowerPC/instr-properties.ll
@@ -0,0 +1,9 @@
+; RUN: llc < %s -mtriple=powerpc64le-unknown-linux-gnu -mcpu=pwr8 -verify-misched -stop-after=machine-scheduler -o - | FileCheck %s --check-prefix=CHECK-P8
+
+; Verify XFLOADf64 didn't implict def 'rm'.
+define double @rm() {
+; CHECK-P8-LABEL: bb.0.entry
+; CHECK-P8: %{{[0-9]+}}:vsfrc = XFLOADf64 $zero8, %{{[0-9]+}} ::
+entry:
+  ret double 2.300000e+00
+}


        


More information about the llvm-commits mailing list