diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2017-03-09 01:11:15 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2017-03-09 01:11:15 +0000 |
commit | 0152c8156be6aa8c3e85903625fa3e76206dca8b (patch) | |
tree | 1af091564511a6f63b8dcb428cc55c930d5df9d7 /llvm/test/Transforms/WholeProgramDevirt/import.ll | |
parent | 3f57cff1e821d742c71e46dae67aadd65e2f1be2 (diff) | |
download | bcm5719-llvm-0152c8156be6aa8c3e85903625fa3e76206dca8b.tar.gz bcm5719-llvm-0152c8156be6aa8c3e85903625fa3e76206dca8b.zip |
WholeProgramDevirt: Implement importing for uniform ret val opt.
Differential Revision: https://reviews.llvm.org/D29854
llvm-svn: 297350
Diffstat (limited to 'llvm/test/Transforms/WholeProgramDevirt/import.ll')
-rw-r--r-- | llvm/test/Transforms/WholeProgramDevirt/import.ll | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/test/Transforms/WholeProgramDevirt/import.ll b/llvm/test/Transforms/WholeProgramDevirt/import.ll index f0727b4c023..b54eeb7314a 100644 --- a/llvm/test/Transforms/WholeProgramDevirt/import.ll +++ b/llvm/test/Transforms/WholeProgramDevirt/import.ll @@ -1,8 +1,12 @@ ; RUN: opt -S -wholeprogramdevirt -wholeprogramdevirt-summary-action=import -wholeprogramdevirt-read-summary=%S/Inputs/import-single-impl.yaml < %s | FileCheck --check-prefixes=CHECK,SINGLE-IMPL %s +; RUN: opt -S -wholeprogramdevirt -wholeprogramdevirt-summary-action=import -wholeprogramdevirt-read-summary=%S/Inputs/import-uniform-ret-val.yaml < %s | FileCheck --check-prefixes=CHECK,UNIFORM-RET-VAL %s target datalayout = "e-p:64:64" target triple = "x86_64-unknown-linux-gnu" +; Test cases where the argument values are known and we can apply virtual +; constant propagation. + ; CHECK: define i32 @call1 define i32 @call1(i8* %obj) { %vtableptr = bitcast i8* %obj to [3 x i8*]** @@ -15,9 +19,13 @@ define i32 @call1(i8* %obj) { %fptr_casted = bitcast i8* %fptr to i32 (i8*, i32)* ; SINGLE-IMPL: call i32 bitcast (void ()* @singleimpl1 to i32 (i8*, i32)*) %result = call i32 %fptr_casted(i8* %obj, i32 1) + ; UNIFORM-RET-VAL: ret i32 42 ret i32 %result } +; Test cases where the argument values are unknown, so we cannot apply virtual +; constant propagation. + ; CHECK: define i1 @call2 define i1 @call2(i8* %obj) { %vtableptr = bitcast i8* %obj to [1 x i8*]** @@ -32,6 +40,7 @@ define i1 @call2(i8* %obj) { cont: %fptr_casted = bitcast i8* %fptr to i1 (i8*, i32)* ; SINGLE-IMPL: call i1 bitcast (void ()* @singleimpl2 to i1 (i8*, i32)*) + ; UNIFORM-RET-VAL: call i1 % %result = call i1 %fptr_casted(i8* %obj, i32 undef) ret i1 %result |