diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2016-06-16 22:34:04 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2016-06-16 22:34:04 +0000 |
commit | 45fa0fd758dd4eb20cca6f36d1b43dd1274c5ad7 (patch) | |
tree | f2a80a81f3e97a96b8c4e627e49f35b047603464 /llvm/test/Transforms/SafeStack/array-aligned.ll | |
parent | 72d961a1da712ba0f50a8092ac68cde76f44cc5d (diff) | |
download | bcm5719-llvm-45fa0fd758dd4eb20cca6f36d1b43dd1274c5ad7.tar.gz bcm5719-llvm-45fa0fd758dd4eb20cca6f36d1b43dd1274c5ad7.zip |
[safestack] Sink unsafe address computation to each use.
This is a fix for PR27844.
When replacing uses of unsafe allocas, emit the new location
immediately after each use. Without this, the pointer stays live from
the function entry to the last use, while it's usually cheaper to
recalculate.
llvm-svn: 272969
Diffstat (limited to 'llvm/test/Transforms/SafeStack/array-aligned.ll')
-rw-r--r-- | llvm/test/Transforms/SafeStack/array-aligned.ll | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/test/Transforms/SafeStack/array-aligned.ll b/llvm/test/Transforms/SafeStack/array-aligned.ll index 4676903ec77..26558e4fa81 100644 --- a/llvm/test/Transforms/SafeStack/array-aligned.ll +++ b/llvm/test/Transforms/SafeStack/array-aligned.ll @@ -13,16 +13,15 @@ entry: ; CHECK: store i8* %[[USST]], i8** @__safestack_unsafe_stack_ptr - ; CHECK: %[[AADDR:.*]] = alloca i8*, align 8 %a.addr = alloca i8*, align 8 - - ; CHECK: %[[BUFPTR:.*]] = getelementptr i8, i8* %[[USP]], i32 -16 - ; CHECK: %[[BUFPTR2:.*]] = bitcast i8* %[[BUFPTR]] to [16 x i8]* %buf = alloca [16 x i8], align 16 + ; CHECK: %[[AADDR:.*]] = alloca i8*, align 8 ; CHECK: store i8* {{.*}}, i8** %[[AADDR]], align 8 store i8* %a, i8** %a.addr, align 8 + ; CHECK: %[[BUFPTR:.*]] = getelementptr i8, i8* %[[USP]], i32 -16 + ; CHECK: %[[BUFPTR2:.*]] = bitcast i8* %[[BUFPTR]] to [16 x i8]* ; CHECK: %[[GEP:.*]] = getelementptr inbounds [16 x i8], [16 x i8]* %[[BUFPTR2]], i32 0, i32 0 %gep = getelementptr inbounds [16 x i8], [16 x i8]* %buf, i32 0, i32 0 |