summaryrefslogtreecommitdiff
path: root/lib/CodeGen/StackColoring.cpp
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@mips.com>2013-05-14 01:42:44 +0000
committerAkira Hatanaka <ahatanaka@mips.com>2013-05-14 01:42:44 +0000
commitdd29df06fa72de9e370cdd9d8e32ac5437a578c7 (patch)
tree00d3771ce714a1d5aaa8d2655684dc33442ab526 /lib/CodeGen/StackColoring.cpp
parent17a692e7f196c15118e69d7012d110aa00a362ba (diff)
downloadllvm-dd29df06fa72de9e370cdd9d8e32ac5437a578c7.tar.gz
llvm-dd29df06fa72de9e370cdd9d8e32ac5437a578c7.tar.bz2
llvm-dd29df06fa72de9e370cdd9d8e32ac5437a578c7.tar.xz
StackColoring: don't clear an instruction's mem operand if the underlying
object is a PseudoSourceValue and PseudoSourceValue::isConstant returns true (i.e., points to memory that has a constant value). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181751 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/StackColoring.cpp')
-rw-r--r--lib/CodeGen/StackColoring.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/CodeGen/StackColoring.cpp b/lib/CodeGen/StackColoring.cpp
index a789a2596d..90b93aaa72 100644
--- a/lib/CodeGen/StackColoring.cpp
+++ b/lib/CodeGen/StackColoring.cpp
@@ -42,6 +42,7 @@
#include "llvm/CodeGen/MachineMemOperand.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
+#include "llvm/CodeGen/PseudoSourceValue.h"
#include "llvm/CodeGen/SlotIndexes.h"
#include "llvm/DebugInfo.h"
#include "llvm/IR/Function.h"
@@ -528,6 +529,10 @@ void StackColoring::remapInstructions(DenseMap<int, int> &SlotRemap) {
if (!V)
continue;
+ const PseudoSourceValue *PSV = dyn_cast<const PseudoSourceValue>(V);
+ if (PSV && PSV->isConstant(MFI))
+ continue;
+
// Climb up and find the original alloca.
V = GetUnderlyingObject(V);
// If we did not find one, or if the one that we found is not in our