diff options
author | Dylan McKay <me@dylanmckay.io> | 2018-12-18 09:52:52 +0000 |
---|---|---|
committer | Dylan McKay <me@dylanmckay.io> | 2018-12-18 09:52:52 +0000 |
commit | f920da009e4c27b06ad5b301995db620dd8be1db (patch) | |
tree | 2cd8e1293c8244e64435eefa0fa8a64d977b6556 /llvm/test/Transforms/MergeFunc/nonzero-address-spaces.ll | |
parent | c94e26c71d1a3c9bd85826e7d62940b2c10114a9 (diff) | |
download | bcm5719-llvm-f920da009e4c27b06ad5b301995db620dd8be1db.tar.gz bcm5719-llvm-f920da009e4c27b06ad5b301995db620dd8be1db.zip |
[IPO][AVR] Create new Functions in the default address space specified in the data layout
This modifies the IPO pass so that it respects any explicit function
address space specified in the data layout.
In targets with nonzero program address spaces, all functions should, by
default, be placed into the default program address space.
This is required for Harvard architectures like AVR. Without this, the
functions will be marked as residing in data space, and thus not be
callable.
This has no effect to any in-tree official backends, as none use an
explicit program address space in their data layouts.
Patch by Tim Neumann.
llvm-svn: 349469
Diffstat (limited to 'llvm/test/Transforms/MergeFunc/nonzero-address-spaces.ll')
-rw-r--r-- | llvm/test/Transforms/MergeFunc/nonzero-address-spaces.ll | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/llvm/test/Transforms/MergeFunc/nonzero-address-spaces.ll b/llvm/test/Transforms/MergeFunc/nonzero-address-spaces.ll new file mode 100644 index 00000000000..3ee887c9de0 --- /dev/null +++ b/llvm/test/Transforms/MergeFunc/nonzero-address-spaces.ll @@ -0,0 +1,30 @@ +; RUN: opt -S -mergefunc < %s | FileCheck %s + +; MergeFunctions should respect the default function address +; space specified in the data layout. + +target datalayout = "e-P1-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" + +declare void @stuff() + +; CHECK-LABEL: @f0( +define void @f0(i64 %p0) { +entry: + call void @stuff() + call void @stuff() + call void @stuff() + ret void +} + +; CHECK-LABEL: @f1( +; CHECK: ptrtoint i64* +; CHECK: tail call addrspace(1) void @f0(i64 + +define void @f1(i64* %p0) { +entry: + call void @stuff() + call void @stuff() + call void @stuff() + ret void +} + |