Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Unified Diff: src/IceInst.cpp

Issue 2124973005: Selectively invert ICMP operands for better address optimization (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Address Comments Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceInst.h ('k') | src/IceInst.def » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceInst.cpp
diff --git a/src/IceInst.cpp b/src/IceInst.cpp
index 3a07b52e4f97a755a6249f0ac1e1691332483941..2d67f377be8278c45e9d9dd84c5656c5e5152db7 100644
--- a/src/IceInst.cpp
+++ b/src/IceInst.cpp
@@ -65,9 +65,10 @@ const struct InstFcmpAttributes_ {
// Using non-anonymous struct so that array_lengthof works.
const struct InstIcmpAttributes_ {
const char *DisplayString;
+ InstIcmp::ICond Reverse;
} InstIcmpAttributes[] = {
-#define X(tag, str) \
- { str } \
+#define X(tag, reverse, str) \
+ { str, InstIcmp::ICond::reverse } \
,
ICEINSTICMP_TABLE
#undef X
@@ -1085,6 +1086,10 @@ void InstTarget::dump(const Cfg *Func) const {
InstBreakpoint::InstBreakpoint(Cfg *Func)
: InstHighLevel(Func, Inst::Breakpoint, 0, nullptr) {}
+void InstIcmp::reverseConditionAndOperands() {
+ Condition = InstIcmpAttributes[Condition].Reverse;
+ std::swap(Srcs[0], Srcs[1]);
+}
bool checkForRedundantAssign(const Variable *Dest, const Operand *Source) {
const auto *SrcVar = llvm::dyn_cast<const Variable>(Source);
if (!SrcVar)
« no previous file with comments | « src/IceInst.h ('k') | src/IceInst.def » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698