mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-09 05:13:01 +00:00
Fix a case where LSR is sensitive to debug info.
llvm-svn: 97830
This commit is contained in:
parent
3346ea1d4e
commit
5c83d9b9b8
@ -15,6 +15,7 @@
|
|||||||
|
|
||||||
#include "llvm/Analysis/ScalarEvolutionExpander.h"
|
#include "llvm/Analysis/ScalarEvolutionExpander.h"
|
||||||
#include "llvm/Analysis/LoopInfo.h"
|
#include "llvm/Analysis/LoopInfo.h"
|
||||||
|
#include "llvm/IntrinsicInst.h"
|
||||||
#include "llvm/LLVMContext.h"
|
#include "llvm/LLVMContext.h"
|
||||||
#include "llvm/Target/TargetData.h"
|
#include "llvm/Target/TargetData.h"
|
||||||
#include "llvm/ADT/STLExtras.h"
|
#include "llvm/ADT/STLExtras.h"
|
||||||
@ -137,6 +138,10 @@ Value *SCEVExpander::InsertBinop(Instruction::BinaryOps Opcode,
|
|||||||
if (IP != BlockBegin) {
|
if (IP != BlockBegin) {
|
||||||
--IP;
|
--IP;
|
||||||
for (; ScanLimit; --IP, --ScanLimit) {
|
for (; ScanLimit; --IP, --ScanLimit) {
|
||||||
|
// Don't count dbg.value against the ScanLimit, to avoid perturbing the
|
||||||
|
// generated code.
|
||||||
|
if (isa<DbgInfoIntrinsic>(IP))
|
||||||
|
ScanLimit++;
|
||||||
if (IP->getOpcode() == (unsigned)Opcode && IP->getOperand(0) == LHS &&
|
if (IP->getOpcode() == (unsigned)Opcode && IP->getOperand(0) == LHS &&
|
||||||
IP->getOperand(1) == RHS)
|
IP->getOperand(1) == RHS)
|
||||||
return IP;
|
return IP;
|
||||||
@ -505,6 +510,10 @@ Value *SCEVExpander::expandAddToGEP(const SCEV *const *op_begin,
|
|||||||
if (IP != BlockBegin) {
|
if (IP != BlockBegin) {
|
||||||
--IP;
|
--IP;
|
||||||
for (; ScanLimit; --IP, --ScanLimit) {
|
for (; ScanLimit; --IP, --ScanLimit) {
|
||||||
|
// Don't count dbg.value against the ScanLimit, to avoid perturbing the
|
||||||
|
// generated code.
|
||||||
|
if (isa<DbgInfoIntrinsic>(IP))
|
||||||
|
ScanLimit++;
|
||||||
if (IP->getOpcode() == Instruction::GetElementPtr &&
|
if (IP->getOpcode() == Instruction::GetElementPtr &&
|
||||||
IP->getOperand(0) == V && IP->getOperand(1) == Idx)
|
IP->getOperand(0) == V && IP->getOperand(1) == Idx)
|
||||||
return IP;
|
return IP;
|
||||||
|
Loading…
Reference in New Issue
Block a user