From 729b5ff1c51532b0301074a9fe3b80304c114b01 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 31 Mar 2008 20:32:52 +0000 Subject: Fix a DAGCombiner optimization to respect volatile qualification. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48994 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/CodeGen') diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 9f44c6a..4eccb81 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -4387,7 +4387,8 @@ SDOperand DAGCombiner::visitLOAD(SDNode *N) { // value. // TODO: Handle store large -> read small portion. // TODO: Handle TRUNCSTORE/LOADEXT - if (LD->getExtensionType() == ISD::NON_EXTLOAD) { + if (LD->getExtensionType() == ISD::NON_EXTLOAD && + !LD->isVolatile()) { if (ISD::isNON_TRUNCStore(Chain.Val)) { StoreSDNode *PrevST = cast(Chain); if (PrevST->getBasePtr() == Ptr && -- cgit v1.1