diff options
author | Tim Northover <tnorthover@apple.com> | 2019-05-10 11:23:04 +0000 |
---|---|---|
committer | Tim Northover <tnorthover@apple.com> | 2019-05-10 11:23:04 +0000 |
commit | 6c1e3f94938f29ff4bbc447c489fe951a4529042 (patch) | |
tree | 1a742f6278cc4749ccefcbdc37435f6d21cc904d /llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | |
parent | c8e68253deb2c50457b23beb2d60e81ff5d04f79 (diff) | |
download | bcm5719-llvm-6c1e3f94938f29ff4bbc447c489fe951a4529042.tar.gz bcm5719-llvm-6c1e3f94938f29ff4bbc447c489fe951a4529042.zip |
SelectionDAG: accommodate atomic floating stores.
We were applying a pointer truncation to floating types, which crashed LLVM.
That is Not A Good Thing(TM).
llvm-svn: 360421
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index 75349cb8e3b..e58b0d22d9a 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -4717,7 +4717,10 @@ void SelectionDAGBuilder::visitAtomicStore(const StoreInst &I) { MemVT.getStoreSize(), I.getAlignment(), AAMDNodes(), nullptr, SSID, Ordering); - SDValue Val = DAG.getPtrExtOrTrunc(getValue(I.getValueOperand()), dl, MemVT); + SDValue Val = getValue(I.getValueOperand()); + if (Val.getValueType() != MemVT) + Val = DAG.getPtrExtOrTrunc(Val, dl, MemVT); + SDValue OutChain = DAG.getAtomic(ISD::ATOMIC_STORE, dl, MemVT, InChain, getValue(I.getPointerOperand()), Val, MMO); |