Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
c6d65967
Commit
c6d65967
authored
Oct 16, 2014
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some more patchpoint-related llvm patches
parent
d3657206
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
311 additions
and
0 deletions
+311
-0
llvm_patches/0008-Add-llvm.experimental.patchpoint.double.patch
...atches/0008-Add-llvm.experimental.patchpoint.double.patch
+239
-0
llvm_patches/0009-Filter-out-extraneous-registers-from-live-outs-like-.patch
...ilter-out-extraneous-registers-from-live-outs-like-.patch
+72
-0
No files found.
llvm_patches/0008-Add-llvm.experimental.patchpoint.double.patch
0 → 100644
View file @
c6d65967
This diff is collapsed.
Click to expand it.
llvm_patches/0009-Filter-out-extraneous-registers-from-live-outs-like-.patch
0 → 100644
View file @
c6d65967
From d29f41a06219e5e9176722a9960caee3399ab104 Mon Sep 17 00:00:00 2001
From: Kevin Modzelewski <kevmod@gmail.com>
Date: Mon, 13 Oct 2014 16:16:17 -0700
Subject: [PATCH] Filter out extraneous registers from live outs, like eflags and rip
---
lib/CodeGen/StackMaps.cpp | 22 +++++++++++++++-------
1 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/lib/CodeGen/StackMaps.cpp b/lib/CodeGen/StackMaps.cpp
index a32a7c1..e5f84a1 100644
--- a/lib/CodeGen/StackMaps.cpp
+++ b/lib/CodeGen/StackMaps.cpp
@@ -139,19 +139,19 @@
StackMaps::parseOperand(MachineInstr::const_mop_iterator MOI,
}
/// Go up the super-register chain until we hit a valid dwarf register number.
-static unsigned getDwarfRegNum(unsigned Reg, const TargetRegisterInfo *TRI) {
+static int getDwarfRegNum(unsigned Reg, const TargetRegisterInfo *TRI) {
int RegNo = TRI->getDwarfRegNum(Reg, false);
for (MCSuperRegIterator SR(Reg, TRI); SR.isValid() && RegNo < 0; ++SR)
RegNo = TRI->getDwarfRegNum(*SR, false);
- assert(RegNo >= 0 && "Invalid Dwarf register number.");
- return (unsigned) RegNo;
+ return (int) RegNo;
}
/// Create a live-out register record for the given register Reg.
StackMaps::LiveOutReg
StackMaps::createLiveOutReg(unsigned Reg, const TargetRegisterInfo *TRI) const {
- unsigned RegNo = getDwarfRegNum(Reg, TRI);
+ int RegNo = getDwarfRegNum(Reg, TRI);
+ assert(RegNo >= 0 && "Invalid Dwarf register number.");
unsigned Size = TRI->getMinimalPhysRegClass(Reg)->getSize();
return LiveOutReg(Reg, RegNo, Size);
}
@@ -165,9 +165,16 @@
StackMaps::parseRegisterLiveOutMask(const uint32_t *Mask) const {
LiveOutVec LiveOuts;
// Create a LiveOutReg for each bit that is set in the register mask.
- for (unsigned Reg = 0, NumRegs = TRI->getNumRegs(); Reg != NumRegs; ++Reg)
- if ((Mask[Reg / 32] >> Reg % 32) & 1)
+ for (unsigned Reg = 0, NumRegs = TRI->getNumRegs(); Reg != NumRegs; ++Reg) {
+ if ((Mask[Reg / 32] >> Reg % 32) & 1) {
+ int RegNo = getDwarfRegNum(Reg, TRI);
+ if (RegNo < 0)
+ continue;
+ if (!TRI->isInAllocatableClass(Reg))
+ continue;
LiveOuts.push_back(createLiveOutReg(Reg, TRI));
+ }
+ }
// We don't need to keep track of a register if its super-register is already
// in the list. Merge entries that refer to the same dwarf register and use
@@ -400,10 +407,11 @@
void StackMaps::emitCallsiteEntries(MCStreamer &OS,
unsigned OperIdx = 0;
for (const auto &Loc : CSLocs) {
- unsigned RegNo = 0;
+ int RegNo = 0;
int Offset = Loc.Offset;
if(Loc.Reg) {
RegNo = getDwarfRegNum(Loc.Reg, TRI);
+ assert(RegNo >= 0 && "Invalid Dwarf register number.");
// If this is a register location, put the subregister byte offset in
// the location offset.
--
1.7.4.1
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment