[PATCH] D87046: [PPC] Do not emit extswsli in 32BIT mode when using -mcpu=pwr9

Zarko Todorovski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 21 05:13:06 PDT 2020


ZarkoCA marked 3 inline comments as done.
ZarkoCA added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCISelLowering.cpp:16066
       N0.getOperand(0).getValueType() != MVT::i32 ||
       CN1 == nullptr || N->getValueType(0) != MVT::i64)
     return SDValue();
----------------
Xiangling_L wrote:
> It seems you can move `Subtarget.isPPC64()` here instead. Since the following code returns `SDValue()` for 32bit no matter what.
It is better to add it there. 


================
Comment at: llvm/test/CodeGen/PowerPC/ppc-32bit-shift.ll:10
+; RUN:     -mattr=-altivec -mcpu=pwr9 < %s | FileCheck %s --check-prefix=64BIT
+; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \
+; RUN:     -mattr=-altivec -mcpu=pwr9 < %s | FileCheck %s --check-prefix=64BIT
----------------
Xiangling_L wrote:
> The failing reason has nothing to do with endian but only related to 32bit or 64bit mode. So I am suggesting you can test `-mtriple=powerpc` and `-mtriple=powerpc64` only
Good point, we only care about 32/64bit. 


================
Comment at: llvm/test/CodeGen/PowerPC/ppc-32bit-shift.ll:17
+  %add = add nsw i32 %inta, %intb
+  %conv = sext i32 %add to i64
+  %shl = shl nsw i64 %conv, 8
----------------
Xiangling_L wrote:
> We can simplify the testcase like the following:
> define void @a(i32 %add, i64* %sum_a) {
> entry:
>     %conv = sext i32 %add to i64
>     %shl = shl nsw i64 %conv, 8
>     store i64 %shl, i64* %sum_a, align 8
>     ret void
>  }
That's much better, thanks. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87046



More information about the llvm-commits mailing list