summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/LICM.cpp
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2014-07-10 05:27:53 +0000
committerHal Finkel <hfinkel@anl.gov>2014-07-10 05:27:53 +0000
commit2e42c34d058e5b068ec1cd6dae6cd388937c6e3c (patch)
tree668c0e1f90005c2c089d05633dd246d5c001ee7f /llvm/lib/Transforms/Scalar/LICM.cpp
parentb35103ebb9aafd978f52201b542689f706914063 (diff)
downloadbcm5719-llvm-2e42c34d058e5b068ec1cd6dae6cd388937c6e3c.tar.gz
bcm5719-llvm-2e42c34d058e5b068ec1cd6dae6cd388937c6e3c.zip
Allow isDereferenceablePointer to look through some bitcasts
isDereferenceablePointer should not give up upon encountering any bitcast. If we're casting from a pointer to a larger type to a pointer to a small type, we can continue by examining the bitcast's operand. This missing capability was noted in a comment in the function. In order for this to work, isDereferenceablePointer now takes an optional DataLayout pointer (essentially all callers already had such a pointer available). Most code uses isDereferenceablePointer though isSafeToSpeculativelyExecute (which already took an optional DataLayout pointer), and to enable the LICM test case, LICM needs to actually provide its DL pointer to isSafeToSpeculativelyExecute (which it was not doing previously). llvm-svn: 212686
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LICM.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/LICM.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp
index bc1db373313..abcceb20050 100644
--- a/llvm/lib/Transforms/Scalar/LICM.cpp
+++ b/llvm/lib/Transforms/Scalar/LICM.cpp
@@ -639,7 +639,7 @@ void LICM::hoist(Instruction &I) {
///
bool LICM::isSafeToExecuteUnconditionally(Instruction &Inst) {
// If it is not a trapping instruction, it is always safe to hoist.
- if (isSafeToSpeculativelyExecute(&Inst))
+ if (isSafeToSpeculativelyExecute(&Inst, DL))
return true;
return isGuaranteedToExecute(Inst);
OpenPOWER on IntegriCloud