Andrew Zhogin via llvm-dev
2016-Jul-17 18:29 UTC
[llvm-dev] llvm PeepholeOptimizer + optimizeLoadInstr question
Hello Lang, PeepholeOptimizer allows backend to provide optimizeLoadInstr function to fold memory-load operand. But it doesn't work for folding load operand into store instruction (combine into memory-to-memory instruction). It is rare case, but some backends have such instructions (like SystemZ MVC). It doesn't work because "FoldAsLoadDefCandidates.clear()" occurs too early, before current instruction "optimizeLoadInstr" check. Could "FoldAsLoadDefCandidates.clear()" be moved later? After "!isLoadFoldable(...) && !FoldAsLoadDefCandidates.empty()" condition check. -- Thanks, Andrew -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160718/a820fae0/attachment.html>
Hal Finkel via llvm-dev
2016-Aug-14 18:05 UTC
[llvm-dev] llvm PeepholeOptimizer + optimizeLoadInstr question
Hi Andrew, Is this still an open question? I took a quick look at the code and I think the change you're proposing makes sense. If you'd like to pursue this, I recommend posting a patch for review. -Hal ----- Original Message -----> From: "Andrew Zhogin via llvm-dev" <llvm-dev at lists.llvm.org> > To: lhames at gmail.com > Cc: llvm-dev at lists.llvm.org > Sent: Sunday, July 17, 2016 1:29:34 PM > Subject: [llvm-dev] llvm PeepholeOptimizer + optimizeLoadInstr > question> Hello Lang,> PeepholeOptimizer allows backend to provide optimizeLoadInstr > function to fold memory-load operand.> But it doesn't work for folding load operand into store instruction > (combine into memory-to-memory instruction). > It is rare case, but some backends have such instructions (like > SystemZ MVC).> It doesn't work because "FoldAsLoadDefCandidates.clear()" occurs too > early, before current instruction "optimizeLoadInstr" check.> Could "FoldAsLoadDefCandidates.clear()" be moved later?> After "!isLoadFoldable(...) && !FoldAsLoadDefCandidates.empty()" > condition check.> --> Thanks, > Andrew > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev-- Hal Finkel Assistant Computational Scientist Leadership Computing Facility Argonne National Laboratory -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160814/c019d119/attachment.html>