summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-mca/RegisterFile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-mca/RegisterFile.cpp')
-rw-r--r--llvm/tools/llvm-mca/RegisterFile.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/tools/llvm-mca/RegisterFile.cpp b/llvm/tools/llvm-mca/RegisterFile.cpp
index ea27a8b9b68..cba17a6a6a1 100644
--- a/llvm/tools/llvm-mca/RegisterFile.cpp
+++ b/llvm/tools/llvm-mca/RegisterFile.cpp
@@ -166,7 +166,7 @@ void RegisterFile::addRegisterWrite(WriteRef Write,
const RegisterRenamingInfo &RRI = RegisterMappings[RegID].second;
if (RRI.RenameAs && RRI.RenameAs != RegID) {
RegID = RRI.RenameAs;
- const WriteRef &OtherWrite = RegisterMappings[RegID].first;
+ WriteRef &OtherWrite = RegisterMappings[RegID].first;
if (!WS.clearsSuperRegisters()) {
// The processor keeps the definition of `RegID` together with register
@@ -174,7 +174,8 @@ void RegisterFile::addRegisterWrite(WriteRef Write,
// register is allocated.
ShouldAllocatePhysRegs = false;
- if (OtherWrite.getSourceIndex() != Write.getSourceIndex()) {
+ if (OtherWrite.getWriteState() &&
+ (OtherWrite.getSourceIndex() != Write.getSourceIndex())) {
// This partial write has a false dependency on RenameAs.
WS.setDependentWrite(OtherWrite.getWriteState());
}
OpenPOWER on IntegriCloud