[PATCH] D102819: [PowerPC] Add fix to partword atomic operations

Stefan Pintilie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 20 10:31:48 PDT 2021


stefanp added inline comments.


================
Comment at: llvm/test/CodeGen/PowerPC/ppc-partword-atomic.ll:103
+; PWR9-NEXT:  # %bb.2: # %entry
+; PWR9-NEXT:    clrlwi 3, 4, 16
+; PWR9-NEXT:    addis 4, 2, global_int at toc@ha
----------------
nemanjai wrote:
> Presumably this goes away when https://reviews.llvm.org/D101342 lands? Can you please apply that on top of this patch to make sure? Similarly with line 49.
> Presumably this goes away when https://reviews.llvm.org/D101342 lands? Can you please apply that on top of this patch to make sure? Similarly with line 49.

I have checked this and if I add the patch D101342 then those two lines disappear. 
Here is the diff in the test case with the patch added:
```
--- a/llvm/test/CodeGen/PowerPC/ppc-partword-atomic.ll
+++ b/llvm/test/CodeGen/PowerPC/ppc-partword-atomic.ll
@@ -46,10 +46,9 @@ define dso_local zeroext i32 @testI8(i8 zeroext %val) local_unnamed_addr #0 {
 ; PWR9-NEXT:    stbcx. 3, 0, 5
 ; PWR9-NEXT:    bne 0, .LBB0_1
 ; PWR9-NEXT:  # %bb.2: # %entry
-; PWR9-NEXT:    clrlwi 3, 4, 24
-; PWR9-NEXT:    addis 4, 2, global_int at toc@ha
+; PWR9-NEXT:    addis 3, 2, global_int at toc@ha
 ; PWR9-NEXT:    lwsync
-; PWR9-NEXT:    stw 3, global_int at toc@l(4)
+; PWR9-NEXT:    stw 4, global_int at toc@l(3)
 ; PWR9-NEXT:    li 3, 55
 ; PWR9-NEXT:    blr
 entry:
@@ -100,10 +99,9 @@ define dso_local zeroext i32 @testI16(i16 zeroext %val) local_unnamed_addr #0 {
 ; PWR9-NEXT:    sthcx. 3, 0, 5
 ; PWR9-NEXT:    bne 0, .LBB1_1
 ; PWR9-NEXT:  # %bb.2: # %entry
-; PWR9-NEXT:    clrlwi 3, 4, 16
-; PWR9-NEXT:    addis 4, 2, global_int at toc@ha
+; PWR9-NEXT:    addis 3, 2, global_int at toc@ha
 ; PWR9-NEXT:    lwsync
-; PWR9-NEXT:    stw 3, global_int at toc@l(4)
+; PWR9-NEXT:    stw 4, global_int at toc@l(3)
 ; PWR9-NEXT:    li 3, 55
 ; PWR9-NEXT:    blr
 entry:
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102819/new/

https://reviews.llvm.org/D102819



More information about the llvm-commits mailing list