[PATCH] D20847: BitCast infinite loop fix

Guozhi Wei via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 8 16:49:07 PDT 2016


Carrot added a comment.



>   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

But unfortunately before combineStoreToValueType is called on the store instruction, optimizeBitCastFromPhi is called on the new BitCast again, and this pattern repeats indefinitely.


Repository:
  rL LLVM

https://reviews.llvm.org/D20847





More information about the llvm-commits mailing list