aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
diff options
context:
space:
mode:
authorGuozhi Wei <carrot@google.com>2016-10-25 20:43:42 +0000
committerGuozhi Wei <carrot@google.com>2016-10-25 20:43:42 +0000
commitae541f6a71ebffc96411fc6ce7437ad1cd03181c (patch)
treea39b9b89758a8da7c59c13ef8c86ce239b71c252 /llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
parentb3f709e10f37225ae65c1d48c4623f6abc2cac1e (diff)
downloadllvm-ae541f6a71ebffc96411fc6ce7437ad1cd03181c.zip
llvm-ae541f6a71ebffc96411fc6ce7437ad1cd03181c.tar.gz
llvm-ae541f6a71ebffc96411fc6ce7437ad1cd03181c.tar.bz2
[InstCombine] Resubmit the combine of A->B->A BitCast and fix for pr27996
The original patch of the A->B->A BitCast optimization was reverted by r274094 because it may cause infinite loop inside compiler https://llvm.org/bugs/show_bug.cgi?id=27996. The problem is with following code xB = load (type B); xA = load (type A); +yA = (A)xB; B -> A +zAn = PHI[yA, xA]; PHI +zBn = (B)zAn; // A -> B store zAn; store zBn; optimizeBitCastFromPhi generates +zBn = (B)zAn; // A -> B and expects it will be combined with the following store instruction to another store zAn Unfortunately before combineStoreToValueType is called on the store instruction, optimizeBitCastFromPhi is called on the new BitCast again, and this pattern repeats indefinitely. optimizeBitCastFromPhi only generates BitCast for load/store instructions, only the BitCast before store can cause the reexecution of optimizeBitCastFromPhi, and BitCast before store can easily be handled by InstCombineLoadStoreAlloca.cpp. So the solution to the problem is if all users of a CI are store instructions, we should not do optimizeBitCastFromPhi on it. Then optimizeBitCastFromPhi will not be called on the new BitCast instructions. Differential Revision: https://reviews.llvm.org/D23896 llvm-svn: 285116
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp')
0 files changed, 0 insertions, 0 deletions