diff options
author | Demi Obenour <demiobenour@gmail.com> | 2016-12-09 15:41:59 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2016-12-09 16:38:45 -0500 |
commit | 90fae01c326bf8b0802b4e8968f84886be4e1380 (patch) | |
tree | d91307f5d7811c46dfa3fd8e19e019b82af10f1b /compiler/llvmGen/LlvmCodeGen/CodeGen.hs | |
parent | 62418b878a1e57b6d187c4f98bf90f6cd64a58b6 (diff) | |
download | haskell-90fae01c326bf8b0802b4e8968f84886be4e1380.tar.gz |
Fix LLVM TBAA metadata
Accesses through a Cmm local are currently reported as having the
"other" type, which can only alias other "other" accesses. However,
this assumption is incorrect, which can result in silent bad LLVM
codegen.
Fixes #9308.
Fixes #9504.
Test Plan: GHC CI
Reviewers: rwbarton, austin, bgamari
Reviewed By: bgamari
Subscribers: michalt, thomie
Differential Revision: https://phabricator.haskell.org/D2758
GHC Trac Issues: #9125, #9308, #9504
Diffstat (limited to 'compiler/llvmGen/LlvmCodeGen/CodeGen.hs')
-rw-r--r-- | compiler/llvmGen/LlvmCodeGen/CodeGen.hs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs index 7b610c0a0a..d88d234057 100644 --- a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs +++ b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs @@ -845,8 +845,7 @@ genStore addr@(CmmMachOp (MO_Sub _) [ -- generic case genStore addr val - = do other <- getTBAAMeta otherN - genStore_slow addr val other + = getTBAAMeta topN >>= genStore_slow addr val -- | CmmStore operation -- This is a special case for storing to a global register pointer @@ -1494,8 +1493,7 @@ genLoad atomic e@(CmmMachOp (MO_Sub _) [ -- generic case genLoad atomic e ty - = do other <- getTBAAMeta otherN - genLoad_slow atomic e ty other + = getTBAAMeta topN >>= genLoad_slow atomic e ty -- | Handle CmmLoad expression. -- This is a special case for loading from a global register pointer |