[PATCH] D32567: [ARM] Miscompilation on arrays promoted to constant pools

Yin Ma via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 27 11:28:40 PDT 2017


yinma added a comment.

Hi, I am facing the same issue.  In my case, I disable the rematerialization of all instructions that referring contant pool. I think only t2LEApcrel is rematerializable right now.  Because 
the safety assumption of ContantIslandPass is that the reference to an constant pool entry should be one use. ARM common subexpression elimination will make single reference to one constant pool, the
rest reference  should be copy. I believe the only re-introduction of referencing instruction is the rematerialization in register allocation pass. If we disable rematerialization. the assumption of one use should hold
until constant island pass in general. So in constant island, we can simply check if the CPE->RefCount is not greater than 1, if is greater than 1, no cloning. How do you think?


Repository:
  rL LLVM

https://reviews.llvm.org/D32567





More information about the llvm-commits mailing list