diff options
| author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2018-06-05 14:52:24 +0000 | 
|---|---|---|
| committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2018-06-05 14:52:24 +0000 | 
| commit | 191bc71541a69cc872a8f313d00b96268b12b0ae (patch) | |
| tree | 230a386bfc67cacc17e5319127b2dfb7ac458f2b /llvm/lib/CodeGen/SelectionDAG | |
| parent | e4ff0bd401ba3e7c61b5a913e9e08fa68bee69b1 (diff) | |
| download | bcm5719-llvm-191bc71541a69cc872a8f313d00b96268b12b0ae.tar.gz bcm5719-llvm-191bc71541a69cc872a8f313d00b96268b12b0ae.zip | |
DAG: Stop dropping invariant/dereferencable
When legalizing illegal FP load results, this was
for some reason dropping the invariant and dereferencable
memory flags. There doesn't seem to be any reason for this,
and the equivalent isn't done for integer loads.
Fixes an issue in a future AMDGPU commit where some identical
loads fail to merge because one of the loads ends up
dropping the flags.
llvm-svn: 334020
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp | 7 | 
1 files changed, 3 insertions, 4 deletions
| diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp index 67661cece5e..b0ae1e0399f 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp @@ -2102,13 +2102,12 @@ SDValue DAGTypeLegalizer::PromoteFloatRes_LOAD(SDNode *N) {    // Load the value as an integer value with the same number of bits.    EVT IVT = EVT::getIntegerVT(*DAG.getContext(), VT.getSizeInBits()); -  auto MMOFlags = -      L->getMemOperand()->getFlags() & -      ~(MachineMemOperand::MOInvariant | MachineMemOperand::MODereferenceable);    SDValue newL = DAG.getLoad(L->getAddressingMode(), L->getExtensionType(), IVT,                               SDLoc(N), L->getChain(), L->getBasePtr(),                               L->getOffset(), L->getPointerInfo(), IVT, -                             L->getAlignment(), MMOFlags, L->getAAInfo()); +                             L->getAlignment(), +                             L->getMemOperand()->getFlags(), +                             L->getAAInfo());    // Legalize the chain result by replacing uses of the old value chain with the    // new one    ReplaceValueWith(SDValue(N, 1), newL.getValue(1)); | 

