mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 22:24:07 +00:00
Feeding isSafeToSpeculativelyExecute its DataLayout pointer
isSafeToSpeculativelyExecute can optionally take a DataLayout pointer. In the past, this was mainly used to make better decisions regarding divisions known not to trap, and so was not all that important for users concerned with "cheap" instructions. However, now it also helps look through bitcasts for dereferencable loads, and will also be important if/when we add a dereferencable pointer attribute. This is some initial work to feed a DataLayout pointer through to callers of isSafeToSpeculativelyExecute, generally where one was already available. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212720 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -23,6 +23,7 @@
|
||||
#include "llvm/Analysis/LoopPass.h"
|
||||
#include "llvm/Analysis/ScalarEvolution.h"
|
||||
#include "llvm/IR/BasicBlock.h"
|
||||
#include "llvm/IR/DataLayout.h"
|
||||
#include "llvm/IR/Dominators.h"
|
||||
#include "llvm/IR/DiagnosticInfo.h"
|
||||
#include "llvm/IR/LLVMContext.h"
|
||||
@ -489,8 +490,10 @@ bool llvm::UnrollLoop(Loop *L, unsigned Count, unsigned TripCount,
|
||||
if (!OuterL && !CompletelyUnroll)
|
||||
OuterL = L;
|
||||
if (OuterL) {
|
||||
DataLayoutPass *DLP = PP->getAnalysisIfAvailable<DataLayoutPass>();
|
||||
const DataLayout *DL = DLP ? &DLP->getDataLayout() : nullptr;
|
||||
ScalarEvolution *SE = PP->getAnalysisIfAvailable<ScalarEvolution>();
|
||||
simplifyLoop(OuterL, DT, LI, PP, /*AliasAnalysis*/ nullptr, SE);
|
||||
simplifyLoop(OuterL, DT, LI, PP, /*AliasAnalysis*/ nullptr, SE, DL);
|
||||
|
||||
// LCSSA must be performed on the outermost affected loop. The unrolled
|
||||
// loop's last loop latch is guaranteed to be in the outermost loop after
|
||||
|
Reference in New Issue
Block a user