[PATCH] D150490: Enable frame pointer for all non-leaf functions on riscv64 Android
Fangrui Song via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri May 12 19:02:28 PDT 2023
MaskRay added inline comments.
================
Comment at: clang/lib/Driver/ToolChains/Clang.cpp:530
+ Triple.isAArch64() || Triple.isPS() || Triple.isVE() ||
+ (Triple.isAndroid() && (Triple.getArch() == llvm::Triple::riscv64)));
if (NoOmitFP || mustUseNonLeafFramePointerForTarget(Triple) ||
----------------
craig.topper wrote:
> You can use Triple.isRISCV64()
&& has a lower precedence than `==`. `==` doesn't need parens.
================
Comment at: clang/test/Driver/frame-pointer-elim.c:109
// RUN: FileCheck --check-prefix=KEEP-NON-LEAF %s
+// RUN: %clang -### -target aarch64-linux-android -S %s 2>&1 | \
+// RUN: FileCheck --check-prefix=KEEP-NON-LEAF %s
----------------
Use `--target=` for new tests. `-target ` has been deprecated since clang 3.x, albeit without a warning.
================
Comment at: clang/test/Driver/frame-pointer.c:61
+// RUN: %clang --target=riscv64-linux-android -### -S -O0 %s 2>&1 | FileCheck -check-prefix=CHECK-ANDROID-64 %s
+// RUN: %clang --target=riscv64-linux-android -### -S -O1 %s 2>&1 | FileCheck -check-prefix=CHECK-ANDROID-64 %s
+// RUN: %clang --target=riscv64-linux-android -### -S -O2 %s 2>&1 | FileCheck -check-prefix=CHECK-ANDROID-64 %s
----------------
I don't think we need so many RUN lines. `-O0` and `-O1` suffice.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D150490/new/
https://reviews.llvm.org/D150490
More information about the cfe-commits
mailing list