[llvm] f0990e1 - [PowerPC]: e500 target can't use lwsync, use msync instead

Justin Hibbits via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 23 15:17:14 PDT 2020


Author: Justin Hibbits
Date: 2020-03-23T17:15:27-05:00
New Revision: f0990e104b0858fbdc4c726cd8da1ff166fe2dca

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

LOG: [PowerPC]: e500 target can't use lwsync, use msync instead

The e500 core has a silicon bug that triggers an illegal instruction
program trap on any sync other than msync.  Other cores will typically
ignore illegal sync types, and the documentation even implies that the
'illegal' bits are ignored.

Address this hardware deficiency by only using msync, like the PPC440.

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

Added: 
    

Modified: 
    llvm/lib/Target/PowerPC/PPC.td
    llvm/test/CodeGen/PowerPC/atomics-fences.ll

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/PowerPC/PPC.td b/llvm/lib/Target/PowerPC/PPC.td
index fc817631e0ac..888b228450b6 100644
--- a/llvm/lib/Target/PowerPC/PPC.td
+++ b/llvm/lib/Target/PowerPC/PPC.td
@@ -463,7 +463,7 @@ def : ProcessorModel<"g5", G5Model,
 def : ProcessorModel<"e500", PPCE500Model,
                   [DirectiveE500,
                    FeatureICBT, FeatureBookE,
-                   FeatureISEL, FeatureMFTB, FeatureSPE]>;
+                   FeatureISEL, FeatureMFTB, FeatureMSYNC, FeatureSPE]>;
 def : ProcessorModel<"e500mc", PPCE500mcModel,
                   [DirectiveE500mc,
                    FeatureSTFIWX, FeatureICBT, FeatureBookE,

diff  --git a/llvm/test/CodeGen/PowerPC/atomics-fences.ll b/llvm/test/CodeGen/PowerPC/atomics-fences.ll
index 3fea72150000..8fe366307fd1 100644
--- a/llvm/test/CodeGen/PowerPC/atomics-fences.ll
+++ b/llvm/test/CodeGen/PowerPC/atomics-fences.ll
@@ -1,6 +1,7 @@
 ; RUN: llc < %s -mtriple=powerpc-unknown-linux-gnu -verify-machineinstrs | FileCheck %s
 ; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu -verify-machineinstrs | FileCheck %s
 ; RUN: llc < %s -mtriple=powerpc-unknown-linux-gnu -mcpu=440 | FileCheck %s --check-prefix=PPC440
+; RUN: llc < %s -mtriple=powerpc-unknown-linux-gnu -mcpu=e500 | FileCheck %s --check-prefix=PPC440
 
 ; Fences
 define void @fence_acquire() {


        


More information about the llvm-commits mailing list