Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
swiftshader
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
swiftshader
Commits
e37076a1
Commit
e37076a1
authored
Jan 27, 2016
by
Eric Holk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UnimplementedLoweringError's message now includes the instruction name.
R=jpp@chromium.org Review URL:
https://codereview.chromium.org/1639063002
.
parent
9aedc2e9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
4 deletions
+54
-4
IceInst.cpp
src/IceInst.cpp
+48
-3
IceInst.h
src/IceInst.h
+4
-0
IceTargetLowering.h
src/IceTargetLowering.h
+2
-1
No files found.
src/IceInst.cpp
View file @
e37076a1
...
...
@@ -77,6 +77,45 @@ Inst::Inst(Cfg *Func, InstKind Kind, SizeT MaxSrcs, Variable *Dest)
:
Kind
(
Kind
),
Number
(
Func
->
newInstNumber
()),
Dest
(
Dest
),
MaxSrcs
(
MaxSrcs
),
Srcs
(
Func
->
allocateArrayOf
<
Operand
*>
(
MaxSrcs
)),
LiveRangesEnded
(
0
)
{}
IceString
Inst
::
getInstName
()
const
{
if
(
!
BuildDefs
::
dump
())
return
"???"
;
switch
(
Kind
)
{
#define X(InstrKind, name) \
case InstrKind: \
return name
X
(
Unreachable
,
"unreachable"
);
X
(
Alloca
,
"alloca"
);
X
(
Arithmetic
,
"arithmetic"
);
X
(
Br
,
"br"
);
X
(
Call
,
"call"
);
X
(
Cast
,
"cast"
);
X
(
ExtractElement
,
"extractelement"
);
X
(
Fcmp
,
"fcmp"
);
X
(
Icmp
,
"icmp"
);
X
(
IntrinsicCall
,
"intrinsiccall"
);
X
(
InsertElement
,
"insertelement"
);
X
(
Load
,
"load"
);
X
(
Phi
,
"phi"
);
X
(
Ret
,
"ret"
);
X
(
Select
,
"select"
);
X
(
Store
,
"store"
);
X
(
Switch
,
"switch"
);
X
(
Assign
,
"assign"
);
X
(
BundleLock
,
"bundlelock"
);
X
(
BundleUnlock
,
"bundleunlock"
);
X
(
FakeDef
,
"fakedef"
);
X
(
FakeUse
,
"fakeuse"
);
X
(
FakeKill
,
"fakekill"
);
X
(
JumpTable
,
"jumptable"
);
#undef X
default
:
assert
(
Kind
>=
Target
);
return
"target"
;
}
}
// Assign the instruction a new number.
void
Inst
::
renumber
(
Cfg
*
Func
)
{
Number
=
isDeleted
()
?
NumberDeleted
:
Func
->
newInstNumber
();
...
...
@@ -233,6 +272,13 @@ InstArithmetic::InstArithmetic(Cfg *Func, OpKind Op, Variable *Dest,
addSource
(
Source2
);
}
IceString
InstArithmetic
::
getInstName
()
const
{
if
(
!
BuildDefs
::
dump
())
return
"???"
;
return
InstArithmeticAttributes
[
getOp
()].
DisplayString
;
}
const
char
*
InstArithmetic
::
getOpName
(
OpKind
Op
)
{
size_t
OpIndex
=
static_cast
<
size_t
>
(
Op
);
return
OpIndex
<
InstArithmetic
::
_num
...
...
@@ -558,7 +604,7 @@ void Inst::dump(const Cfg *Func) const {
return
;
Ostream
&
Str
=
Func
->
getContext
()
->
getStrDump
();
dumpDest
(
Func
);
Str
<<
" =~ "
;
Str
<<
" =~ "
<<
getInstName
()
<<
" "
;
dumpSources
(
Func
);
}
...
...
@@ -630,8 +676,7 @@ void InstArithmetic::dump(const Cfg *Func) const {
return
;
Ostream
&
Str
=
Func
->
getContext
()
->
getStrDump
();
dumpDest
(
Func
);
Str
<<
" = "
<<
InstArithmeticAttributes
[
getOp
()].
DisplayString
<<
" "
<<
getDest
()
->
getType
()
<<
" "
;
Str
<<
" = "
<<
getInstName
()
<<
" "
<<
getDest
()
->
getType
()
<<
" "
;
dumpSources
(
Func
);
}
...
...
src/IceInst.h
View file @
e37076a1
...
...
@@ -76,6 +76,7 @@ public:
};
static_assert
(
Target
<=
Target_Max
,
"Must not be above max."
);
InstKind
getKind
()
const
{
return
Kind
;
}
virtual
IceString
getInstName
()
const
;
InstNumberT
getNumber
()
const
{
return
Number
;
}
void
renumber
(
Cfg
*
Func
);
...
...
@@ -288,6 +289,9 @@ public:
InstArithmetic
(
Func
,
Op
,
Dest
,
Source1
,
Source2
);
}
OpKind
getOp
()
const
{
return
Op
;
}
virtual
IceString
getInstName
()
const
override
;
static
const
char
*
getOpName
(
OpKind
Op
);
bool
isCommutative
()
const
;
void
dump
(
const
Cfg
*
Func
)
const
override
;
...
...
src/IceTargetLowering.h
View file @
e37076a1
...
...
@@ -55,7 +55,8 @@ namespace Ice {
} else { \
/* Use llvm_unreachable instead of report_fatal_error, which gives \
better stack traces. */
\
llvm_unreachable("Not yet implemented"); \
llvm_unreachable( \
("Not yet implemented: " + Instr->getInstName()).c_str()); \
abort(); \
} \
} while (0)
...
...
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