[PATCH] D14398: Strip metadata when speculatively hoisting instructions

Igor Laevsky via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 5 14:31:22 PST 2015


igor-laevsky created this revision.
igor-laevsky added reviewers: sanjoy, chandlerc, reames.
igor-laevsky added a subscriber: llvm-commits.
igor-laevsky set the repository for this revision to rL LLVM.

This is fix for PR24059.

When we are hoisting instruction above some condition it may turn out that metadata on this instruction was control dependant on the condition. So metadata on the hoisted instruction becomes invalid and we need to drop it. See the bug and test cases for the llvm-ir examples. 

This patch should cover most obvious places of speculative execution (which I have found by greping isSafeToSpeculativelyExecute). I think there is more cases but at least it covers the severe ones.

Repository:
  rL LLVM

http://reviews.llvm.org/D14398

Files:
  lib/Analysis/LoopInfo.cpp
  lib/Transforms/Scalar/LICM.cpp
  lib/Transforms/Utils/SimplifyCFG.cpp
  test/Analysis/TypeBasedAliasAnalysis/licm.ll
  test/Transforms/LICM/hoist-deref-load.ll
  test/Transforms/SimplifyCFG/SpeculativeExec.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14398.39410.patch
Type: text/x-patch
Size: 5434 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151105/844a79da/attachment.bin>


More information about the llvm-commits mailing list