aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetar Jovanovic <petarj@mips.com>2013-01-14 17:10:53 +0100
committerPetar Jovanovic <petarj@mips.com>2013-01-24 19:00:03 +0100
commitce330a6f5f1a6d7786c1ec1fd127926e25c12b82 (patch)
treecd3136db78ef9bd102cb9dc68e32e4c50332a8e1
parent8ccd5689414ade8d6dd50706e64179d6d22cba44 (diff)
[MIPS] Skip masking loads and stores via thread pointer.
Register t8 is reserved for thread pointer, and it can not be changed. Thus, the value it has can be trusted, it points to the safe data zone and there is no need to guard it. BUG= https://code.google.com/p/nativeclient/issues/detail?id=2275 TEST= run smoke tests Review URL: https://codereview.chromium.org/11883035
-rw-r--r--lib/Target/Mips/MipsNaClRewritePass.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/Target/Mips/MipsNaClRewritePass.cpp b/lib/Target/Mips/MipsNaClRewritePass.cpp
index f675e5663a..1ef5632e09 100644
--- a/lib/Target/Mips/MipsNaClRewritePass.cpp
+++ b/lib/Target/Mips/MipsNaClRewritePass.cpp
@@ -209,9 +209,12 @@ bool IsDangerousLoad(const MachineInstr &MI, int *AddrIdx) {
break;
}
- if (MI.getOperand(*AddrIdx).getReg() == Mips::SP) {
- // The contents of SP do not require masking.
- return false;
+ switch (MI.getOperand(*AddrIdx).getReg()) {
+ default: break;
+ // The contents of SP and thread pointer register do not require masking.
+ case Mips::SP:
+ case Mips::T8:
+ return false;
}
return true;
@@ -238,9 +241,12 @@ bool IsDangerousStore(const MachineInstr &MI, int *AddrIdx) {
break;
}
- if (MI.getOperand(*AddrIdx).getReg() == Mips::SP) {
- // The contents of SP do not require masking.
- return false;
+ switch (MI.getOperand(*AddrIdx).getReg()) {
+ default: break;
+ // The contents of SP and thread pointer register do not require masking.
+ case Mips::SP:
+ case Mips::T8:
+ return false;
}
return true;