diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp --- a/clang/lib/Driver/ToolChains/Clang.cpp +++ b/clang/lib/Driver/ToolChains/Clang.cpp @@ -613,7 +613,8 @@ A && A->getOption().matches(options::OPT_fno_omit_frame_pointer); bool OmitLeafFP = Args.hasFlag(options::OPT_momit_leaf_frame_pointer, options::OPT_mno_omit_leaf_frame_pointer, - Triple.isAArch64() || Triple.isPS4CPU()); + Triple.isAArch64() || Triple.isPS4CPU() || + Triple.isVE()); if (NoOmitFP || mustUseNonLeafFramePointerForTarget(Triple) || (!OmitFP && useFramePointerForTargetByDefault(Args, Triple))) { if (OmitLeafFP) diff --git a/clang/test/Driver/frame-pointer-elim.c b/clang/test/Driver/frame-pointer-elim.c --- a/clang/test/Driver/frame-pointer-elim.c +++ b/clang/test/Driver/frame-pointer-elim.c @@ -90,7 +90,8 @@ // WARN-OMIT-LEAF-7S-NOT: warning: optimization flag '-momit-leaf-frame-pointer' is not supported for target 'armv7s' // WARN-OMIT-LEAF-7S: "-mframe-pointer=non-leaf" -// On AArch64 and PS4, default to omitting the frame pointer on leaf functions +// On AArch64, PS4, and VE, default to omitting the frame pointer on leaf +// functions // RUN: %clang -### -target aarch64 -S %s 2>&1 | \ // RUN: FileCheck --check-prefix=KEEP-NON-LEAF %s // RUN: %clang -### -target x86_64-scei-ps4 -S %s 2>&1 | \ @@ -99,6 +100,8 @@ // RUN: FileCheck --check-prefix=KEEP-NON-LEAF %s // RUN: %clang -### -target aarch64-apple-darwin -arch arm64_32 -S %s 2>&1 | \ // RUN: FileCheck --check-prefix=KEEP-NON-LEAF %s +// RUN: %clang -### -target ve-unknown-linux-gnu -S %s 2>&1 | \ +// RUN: FileCheck --check-prefix=KEEP-NON-LEAF %s // RUN: %clang -### -target powerpc64 -S %s 2>&1 | \ // RUN: FileCheck --check-prefix=KEEP-ALL %s