diff options
| author | Eli Friedman <efriedma@codeaurora.org> | 2019-01-24 21:31:13 +0000 |
|---|---|---|
| committer | Eli Friedman <efriedma@codeaurora.org> | 2019-01-24 21:31:13 +0000 |
| commit | 525ef0159d663f62755552258dfef2ee38d19005 (patch) | |
| tree | b0929c9cd9a17542549c1e26d83503563bddd897 /llvm/test/Transforms | |
| parent | b0eabefd7b415d8580cafa4e36ea7e4f61772142 (diff) | |
| download | bcm5719-llvm-525ef0159d663f62755552258dfef2ee38d19005.tar.gz bcm5719-llvm-525ef0159d663f62755552258dfef2ee38d19005.zip | |
[Analysis] Fix isSafeToLoadUnconditionally handling of volatile.
A volatile operation cannot be used to prove an address points to normal
memory. (LangRef was recently updated to state it explicitly.)
Differential Revision: https://reviews.llvm.org/D57040
llvm-svn: 352109
Diffstat (limited to 'llvm/test/Transforms')
| -rw-r--r-- | llvm/test/Transforms/SROA/phi-and-select.ll | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/test/Transforms/SROA/phi-and-select.ll b/llvm/test/Transforms/SROA/phi-and-select.ll index e7ba2e89d79..d0904cecd9f 100644 --- a/llvm/test/Transforms/SROA/phi-and-select.ll +++ b/llvm/test/Transforms/SROA/phi-and-select.ll @@ -632,3 +632,15 @@ exit: %result = load i32, i32* %phi, align 4 ret i32 %result } + +; Don't speculate a load based on an earlier volatile operation. +define i8 @volatile_select(i8* %p, i1 %b) { +; CHECK-LABEL: @volatile_select( +; CHECK: select i1 %b, i8* %p, i8* %p2 + %p2 = alloca i8 + store i8 0, i8* %p2 + store volatile i8 0, i8* %p + %px = select i1 %b, i8* %p, i8* %p2 + %v2 = load i8, i8* %px + ret i8 %v2 +} |

