Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1230)

Issue 96065: non inline jumptables for arm

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years, 8 months ago by muth02446
Modified:
4 months, 2 weeks ago
Reviewers:
Base URL:
http://llvm.org/svn/llvm-project/llvm/trunk/
Visibility:
Public.

Patch Set 1 #

Total comments: 7

Patch Set 2 : update to more recent svn rev #

Total comments: 9

Patch Set 3 : some cleanup, added test #

Patch Set 4 : added comments #

Patch Set 5 : attempt at thumb suppport, undid refactoring #

Unified diffs Side-by-side diffs Delta from patch set Stats (+339 lines, -147 lines) Patch
M include/llvm/CodeGen/MachineConstantPool.h View 1 2 3 4 6 chunks +16 lines, -7 lines 0 comments Download
M lib/CodeGen/BranchFolding.cpp View 1 2 3 4 51 chunks +98 lines, -82 lines 0 comments Download
M lib/Target/ARM/ARMConstantPoolValue.h View 1 2 3 4 4 chunks +9 lines, -2 lines 0 comments Download
M lib/Target/ARM/ARMConstantPoolValue.cpp View 1 2 3 4 5 chunks +12 lines, -3 lines 0 comments Download
M lib/Target/ARM/ARMISelLowering.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M lib/Target/ARM/ARMISelLowering.cpp View 1 2 3 4 7 chunks +23 lines, -3 lines 0 comments Download
M lib/Target/ARM/ARMInstrInfo.td View 1 2 3 4 9 chunks +18 lines, -8 lines 0 comments Download
M lib/Target/ARM/ARMInstrThumb.td View 2 chunks +6 lines, -1 line 0 comments Download
M lib/Target/ARM/ARMSubtarget.h View 1 2 3 4 2 chunks +4 lines, -0 lines 0 comments Download
M lib/Target/ARM/ARMSubtarget.cpp View 1 2 3 4 2 chunks +11 lines, -0 lines 0 comments Download
M lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp View 1 2 3 4 31 chunks +52 lines, -41 lines 0 comments Download
A test/CodeGen/ARM/switch.ll View 3 4 1 chunk +89 lines, -0 lines 0 comments Download

Messages

Total messages: 1
muth02446
14 years, 8 months ago (2009-07-17 21:02:30 UTC) #1
http://codereview.appspot.com/96065/diff/1/2
File include/llvm/CodeGen/MachineConstantPool.h (right):

http://codereview.appspot.com/96065/diff/1/2#newcode51
Line 51: /// getJumpTableIndex - Check if this is a reference to a jump table.
this is confusing.
Indicate that this will likely be overloaded (maybe assert
inside to it) and move the comment to overloaded version

http://codereview.appspot.com/96065/diff/1/2#newcode54
Line 54: virtual unsigned *getJumpTableIndex() { return 0; }
why is it returning a pointer?
Should there be separate "Set" function

http://codereview.appspot.com/96065/diff/1/11
File lib/CodeGen/BranchFolding.cpp (right):

http://codereview.appspot.com/96065/diff/1/11#newcode249
Line 249: const std::vector<MachineConstantPoolEntry> &CPs =
this very magical 

could it be moved to a separate function with a meaningful name  like
"RemapJumpTableIndicesAndMarkTargetLive

http://codereview.appspot.com/96065/diff/1/7
File lib/Target/ARM/ARMISelLowering.cpp (right):

http://codereview.appspot.com/96065/diff/1/7#newcode1131
Line 1131: SDValue ARMTargetLowering::LowerJumpTable(SDValue Op, SelectionDAG
&DAG) {
this should be commented

http://codereview.appspot.com/96065/diff/1/7#newcode1134
Line 1134: MVT PTy = getPointerTy();
It would be nice to mark everything const that is readonly
but this does not seem to be common practice in this code base

http://codereview.appspot.com/96065/diff/1/7#newcode1141
Line 1141: Result = DAG.getNode(ARMISD::Wrapper, dl, PTy, Result);
I find chaining of variable in this way hard to read.
especially when this is done several time.
Result is also not a very meaningful name.

How about calling the first one ScaledIndex.

To somebody not deeply involved in the ARM code base the 
ARMISD::Wrapper node is mysterious and a comment would not hurt

http://codereview.appspot.com/96065/diff/1/6
File lib/Target/ARM/ARMInstrInfo.td (right):

http://codereview.appspot.com/96065/diff/1/6#newcode558
Line 558: // Indirect branches
probably only works for amv5 and higher (c.f. code using "blx" below)

http://codereview.appspot.com/96065/diff/12/13
File include/llvm/CodeGen/MachineConstantPool.h (right):

http://codereview.appspot.com/96065/diff/12/13#newcode51
Line 51: /// getJumpTableIndex - Check if this is a reference to a jump table.
This comment is confusing.
Maybe move it to the overloading function

http://codereview.appspot.com/96065/diff/12/13#newcode54
Line 54: virtual unsigned *getJumpTableIndex() { return 0; }
maybe always assert inside this function as it should have been overloaded when
called.

http://codereview.appspot.com/96065/diff/12/13#newcode56
Line 56: /// print - Implement operator<<
instead of returning a pointer add a "setter" function
and use getType to determine where it makes sense to call it

http://codereview.appspot.com/96065/diff/12/22
File lib/CodeGen/BranchFolding.cpp (right):

http://codereview.appspot.com/96065/diff/12/22#newcode248
Line 248: 
This is very magical block, could it be moved to a separate function with a
meaningful name like "RemapJumpTableIndicesAndMarkTargetLive

http://codereview.appspot.com/96065/diff/12/22#newcode255
Line 255: if (!JTIndex) continue;
use getType() test

http://codereview.appspot.com/96065/diff/12/22#newcode256
Line 256: *JTIndex = JTMapping[*JTIndex];
use setter

http://codereview.appspot.com/96065/diff/12/18
File lib/Target/ARM/ARMISelLowering.cpp (right):

http://codereview.appspot.com/96065/diff/12/18#newcode1138
Line 1138: 
this function should be better commented.

also, it would be nice to mark everything const that is readonly but this does
not seem to be common practice in this code base

http://codereview.appspot.com/96065/diff/12/18#newcode1149
Line 1149: Result = DAG.getNode(ARMISD::Wrapper, dl, PTy, Result);
I find chaining of variable in this way hard to read. especially when this is
done several time. Result is also not a very meaningful name. How about calling
the first one ScaledIndex. To somebody not deeply involved in the ARM code base
the ARMISD::Wrapper node is mysterious and a comment would not hurt

http://codereview.appspot.com/96065/diff/12/17
File lib/Target/ARM/ARMInstrInfo.td (right):

http://codereview.appspot.com/96065/diff/12/17#newcode590
Line 590: let isBranch = 1, isTerminator = 1, isBarrier = 1, isIndirectBranch =
1 in {
probably only works for amv5 and higher (c.f. code using "blx" below)
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b