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

Unified Diff: lib/CodeGen/BranchFolding.cpp

Issue 939073008: Rebased PNaCl localmods in LLVM to 223109 (Closed)
Patch Set: undo localmod Created 5 years, 10 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 | « lib/CodeGen/AsmPrinter/DwarfDebug.cpp ('k') | lib/CodeGen/LLVMTargetMachine.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/CodeGen/BranchFolding.cpp
diff --git a/lib/CodeGen/BranchFolding.cpp b/lib/CodeGen/BranchFolding.cpp
index 2128da1b8aac0673c84eac151f59765ccaa90bc8..353c8450505da8f1d7a62b4d7f40a3a9f2466da4 100644
--- a/lib/CodeGen/BranchFolding.cpp
+++ b/lib/CodeGen/BranchFolding.cpp
@@ -22,6 +22,7 @@
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/MachineBlockFrequencyInfo.h"
#include "llvm/CodeGen/MachineBranchProbabilityInfo.h"
+#include "llvm/CodeGen/MachineConstantPool.h" // @LOCALMOD
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineJumpTableInfo.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
@@ -247,6 +248,20 @@ bool BranchFolder::OptimizeFunction(MachineFunction &MF,
}
}
+ // @LOCALMOD-START
+ // This currently only used on ARM targets where the ConstantPool
+ // subclass is overloading getJumpTableIndex()
+ const std::vector<MachineConstantPoolEntry>& CPs =
+ MF.getConstantPool()->getConstants();
+ for (unsigned i = 0, e = CPs.size(); i != e; ++i) {
+ if (!CPs[i].isMachineConstantPoolEntry()) continue;
+ unsigned *JTIndex = CPs[i].Val.MachineCPVal->getJumpTableIndex();
+ if (!JTIndex) continue;
+ // Remember that this JT is live.
+ JTIsLive.set(*JTIndex);
+ }
+ // @LOCALMOD-END
+
// Finally, remove dead jump tables. This happens when the
// indirect jump was unreachable (and thus deleted).
for (unsigned i = 0, e = JTIsLive.size(); i != e; ++i)
« no previous file with comments | « lib/CodeGen/AsmPrinter/DwarfDebug.cpp ('k') | lib/CodeGen/LLVMTargetMachine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698