summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen
diff options
context:
space:
mode:
authorJessica Paquette <jpaquette@apple.com>2018-10-29 20:27:07 +0000
committerJessica Paquette <jpaquette@apple.com>2018-10-29 20:27:07 +0000
commite3932eeea4d10d6835fef10e13b15144fedec6fb (patch)
tree7ea8aed3ba241096396d4c0392251780a059613c /llvm/test/CodeGen
parentf503f7fd420cfd095407cea00e531497c13c6b9b (diff)
downloadbcm5719-llvm-e3932eeea4d10d6835fef10e13b15144fedec6fb.tar.gz
bcm5719-llvm-e3932eeea4d10d6835fef10e13b15144fedec6fb.zip
[MachineOutliner] Inherit target features from parent function
If a function has target features, it may contain instructions that aren't represented in the default set of instructions. If the outliner pulls out one of these instructions, and the function doesn't have the right attributes attached, we'll run into an LLVM error explaining that the target doesn't support the necessary feature for the instruction. This makes outlined functions inherit target features from their parents. It also updates the machine-outliner.ll test to check that we're properly inheriting target features. llvm-svn: 345535
Diffstat (limited to 'llvm/test/CodeGen')
-rw-r--r--llvm/test/CodeGen/AArch64/machine-outliner.ll12
1 files changed, 11 insertions, 1 deletions
diff --git a/llvm/test/CodeGen/AArch64/machine-outliner.ll b/llvm/test/CodeGen/AArch64/machine-outliner.ll
index 9d922c27f88..19be14d8d39 100644
--- a/llvm/test/CodeGen/AArch64/machine-outliner.ll
+++ b/llvm/test/CodeGen/AArch64/machine-outliner.ll
@@ -1,6 +1,16 @@
; RUN: llc -verify-machineinstrs -enable-machine-outliner -mtriple=aarch64-apple-darwin < %s | FileCheck %s
; RUN: llc -verify-machineinstrs -enable-machine-outliner -mtriple=aarch64-apple-darwin -mcpu=cortex-a53 -enable-misched=false < %s | FileCheck %s
; RUN: llc -verify-machineinstrs -enable-machine-outliner -enable-linkonceodr-outlining -mtriple=aarch64-apple-darwin < %s | FileCheck %s -check-prefix=ODR
+; RUN: llc -verify-machineinstrs -enable-machine-outliner -mtriple=aarch64-apple-darwin -stop-after=machine-outliner < %s | FileCheck %s -check-prefix=TARGET_FEATURES
+
+; Make sure that we inherit target features from functions and make sure we have
+; the right function attributes.
+; TARGET_FEATURES: define internal void @OUTLINED_FUNCTION_{{[0-9]+}}()
+; TARGET_FEATURES-SAME: #[[ATTR_NUM:[0-9]+]]
+; TARGET_FEATURES-DAG: attributes #[[ATTR_NUM]] = {
+; TARGET_FEATURES-SAME: minsize
+; TARGET_FEATURES-SAME: optsize
+; TARGET_FEATURES-SAME: "target-features"="+sse"
define linkonce_odr void @fish() #0 {
; CHECK-LABEL: _fish:
@@ -95,4 +105,4 @@ define void @dog() #0 {
; CHECK-NEXT: str w8, [sp, #8]
; CHECK-NEXT: ret
-attributes #0 = { noredzone "target-cpu"="cyclone" }
+attributes #0 = { noredzone "target-cpu"="cyclone" "target-features"="+sse" }
OpenPOWER on IntegriCloud