Author: hans Date: Thu Aug 3 09:24:57 2017 New Revision: 309956 URL: http://llvm.org/viewvc/llvm-project?rev=309956&view=rev Log: Merging r309930: ------------------------------------------------------------------------ r309930 | sdardis | 2017-08-03 02:38:46 -0700 (Thu, 03 Aug 2017) | 19 lines
[SelectionDAG] Resolve PR33978. rL306209 taught SelectionDAG how to add the dereferenceable flag when expanding memcpy and memmove. The fix however contained a nit where the offset + size was constructed as an APInt of PointerSize rather than PointerSizeInBits. This lead to isDereferenceableAndAlignedPointer() get truncated values or values which would be sign extended within that function leading to incorrect results. Thanks to Alex Crichton for reporting the issue! This resolves PR33978. Reviewers: inouehrs Differential Revision: https://reviews.llvm.org/D36236 ------------------------------------------------------------------------ Added: llvm/branches/release_50/test/CodeGen/Mips/pr33978.ll - copied unchanged from r309930, llvm/trunk/test/CodeGen/Mips/pr33978.ll Modified: llvm/branches/release_50/ (props changed) llvm/branches/release_50/lib/CodeGen/MachineInstr.cpp Propchange: llvm/branches/release_50/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Thu Aug 3 09:24:57 2017 @@ -1,3 +1,3 @@ /llvm/branches/Apple/Pertwee:110850,110961 /llvm/branches/type-system-rewrite:133420-134817 -/llvm/trunk:155241,308483-308484,308503,308808,308813,308891,308906,308950,308963,308978,308986,309113,309302,309321,309323,309325,309330,309343,309353,309355,309422,309481,309483,309495,309555,309561,309594,309744 +/llvm/trunk:155241,308483-308484,308503,308808,308813,308891,308906,308950,308963,308978,308986,309113,309302,309321,309323,309325,309330,309343,309353,309355,309422,309481,309483,309495,309555,309561,309594,309744,309930 Modified: llvm/branches/release_50/lib/CodeGen/MachineInstr.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_50/lib/CodeGen/MachineInstr.cpp?rev=309956&r1=309955&r2=309956&view=diff ============================================================================== --- llvm/branches/release_50/lib/CodeGen/MachineInstr.cpp (original) +++ llvm/branches/release_50/lib/CodeGen/MachineInstr.cpp Thu Aug 3 09:24:57 2017 @@ -578,10 +578,8 @@ bool MachinePointerInfo::isDereferenceab if (BasePtr == nullptr) return false; - return isDereferenceableAndAlignedPointer(BasePtr, 1, - APInt(DL.getPointerSize(), - Offset + Size), - DL); + return isDereferenceableAndAlignedPointer( + BasePtr, 1, APInt(DL.getPointerSizeInBits(), Offset + Size), DL); } /// getConstantPool - Return a MachinePointerInfo record that refers to the _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits