Skip to content

Commit 1b7531c

Browse files
committed
llvm2alive: create unique !range regs
1 parent 528a5c0 commit 1b7531c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

llvm_util/llvm2alive.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ unsigned constexpr_idx;
8989
unsigned copy_idx;
9090
unsigned alignopbundle_idx;
9191
unsigned metadata_idx;
92+
unsigned range_idx;
9293

9394
#define PARSE_UNOP() \
9495
auto ty = llvm_type2alive(i.getType()); \
@@ -1455,8 +1456,9 @@ class llvm2alive_ : public llvm::InstVisitor<llvm2alive_, unique_ptr<Instr>> {
14551456
auto CR = attr.getValueAsConstantRange();
14561457
vector<Value*> bounds{ make_intconst(CR.getLower()),
14571458
make_intconst(CR.getUpper()) };
1459+
string name = "%#range_" + to_string(range_idx++) + "_" + val.getName();
14581460
return
1459-
make_unique<AssumeVal>(val.getType(), "%#range_" + val.getName(), val,
1461+
make_unique<AssumeVal>(val.getType(), std::move(name), val,
14601462
std::move(bounds), AssumeVal::Range,
14611463
is_welldefined);
14621464
}
@@ -1794,6 +1796,7 @@ class llvm2alive_ : public llvm::InstVisitor<llvm2alive_, unique_ptr<Instr>> {
17941796
copy_idx = 0;
17951797
alignopbundle_idx = 0;
17961798
metadata_idx = 0;
1799+
range_idx = 0;
17971800

17981801
// don't even bother if number of BBs or instructions is huge..
17991802
if (distance(f.begin(), f.end()) > 5000 ||

0 commit comments

Comments
 (0)