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

Issue 577353003: Add call instructions to Subzero's bitcode reader. (Closed)

Created:
6 years, 3 months ago by Karl
Modified:
6 years, 3 months ago
CC:
native-client-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Visibility:
Public.

Description

Patch Set 1 #

Patch Set 2 : Fix nits. #

Total comments: 16

Patch Set 3 : Fix Jim's issues in patch set 2. #

Total comments: 10

Patch Set 4 : Fix remaining issues raised. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1435 lines, -30 lines) Patch
M src/IceConverter.cpp View 1 2 3 2 chunks +32 lines, -19 lines 0 comments Download
M src/IceInst.h View 1 2 3 2 chunks +10 lines, -6 lines 0 comments Download
M src/IceInst.cpp View 1 chunk +6 lines, -0 lines 0 comments Download
M src/IceIntrinsics.h View 1 2 3 3 chunks +31 lines, -0 lines 0 comments Download
M src/IceIntrinsics.cpp View 2 chunks +30 lines, -0 lines 0 comments Download
M src/IceTargetLoweringX8632.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M src/PNaClTranslator.cpp View 1 2 3 7 chunks +173 lines, -4 lines 0 comments Download
A tests_lit/reader_tests/call.ll View 1 chunk +112 lines, -0 lines 0 comments Download
A tests_lit/reader_tests/call-indirect.ll View 1 chunk +33 lines, -0 lines 0 comments Download
A tests_lit/reader_tests/nacl-atomic-intrinsics.ll View 1 2 3 1 chunk +644 lines, -0 lines 0 comments Download
A tests_lit/reader_tests/nacl-fake-intrinsic.ll View 1 2 3 1 chunk +18 lines, -0 lines 0 comments Download
A tests_lit/reader_tests/nacl-other-intrinsics.ll View 1 chunk +345 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (1 generated)
Karl
6 years, 3 months ago (2014-09-18 20:30:18 UTC) #2
Jim Stichnoth
LGTM, but be sure Jan is OK with the intrinsic changes. https://codereview.chromium.org/577353003/diff/20001/src/IceInst.h File src/IceInst.h (right): ...
6 years, 3 months ago (2014-09-18 21:41:54 UTC) #3
Karl
I will wait for Jan's feedback before landing. https://codereview.chromium.org/577353003/diff/20001/src/IceInst.h File src/IceInst.h (right): https://codereview.chromium.org/577353003/diff/20001/src/IceInst.h#newcode299 src/IceInst.h:299: Operand ...
6 years, 3 months ago (2014-09-18 22:01:51 UTC) #4
jvoung (off chromium)
Sorry, still looking through... a small nit for now =) https://codereview.chromium.org/577353003/diff/20001/src/IceInst.h File src/IceInst.h (right): https://codereview.chromium.org/577353003/diff/20001/src/IceInst.h#newcode319 ...
6 years, 3 months ago (2014-09-18 22:04:46 UTC) #5
jvoung (off chromium)
Otherwise LGTM (yay the last instruction type?) https://codereview.chromium.org/577353003/diff/20001/tests_lit/reader_tests/call.ll File tests_lit/reader_tests/call.ll (right): https://codereview.chromium.org/577353003/diff/20001/tests_lit/reader_tests/call.ll#newcode9 tests_lit/reader_tests/call.ll:9: define i32 ...
6 years, 3 months ago (2014-09-18 23:43:54 UTC) #6
Karl
Committed patchset #4 (id:60001) manually as 8df26f3 (tree was closed).
6 years, 3 months ago (2014-09-19 16:33:35 UTC) #7
Karl
6 years, 3 months ago (2014-09-19 20:29:52 UTC) #8
Message was sent while issue was closed.
https://codereview.chromium.org/577353003/diff/20001/src/IceInst.h
File src/IceInst.h (right):

https://codereview.chromium.org/577353003/diff/20001/src/IceInst.h#newcode319
src/IceInst.h:319: bool HasTailCl, bool HasSideEff, InstKind Kind)
On 2014/09/18 22:04:46, jvoung wrote:
> nit: I think we might as well just make the argument name "HasTailCall" and
> "HasSideEffects"?

I agree with using HasTailCall. Changing field back.

https://codereview.chromium.org/577353003/diff/20001/tests_lit/reader_tests/c...
File tests_lit/reader_tests/call.ll (right):

https://codereview.chromium.org/577353003/diff/20001/tests_lit/reader_tests/c...
tests_lit/reader_tests/call.ll:9: define i32 @fib(i32 %n) {
On 2014/09/18 23:43:53, jvoung wrote:
> On 2014/09/18 22:01:50, Karl wrote:
> > On 2014/09/18 21:41:54, stichnot wrote:
> > > Just so I don't have to pore through all these tests...  Are there any
> > > differences between these and the ones with the same name in the lit
tests? 
> > > (other than the RUN and CHECK lines)
> > 
> > Almost. I removed duplicate calls to an intrinsic that was testing
downstream
> > additional compilation issues (ones with suffices more_addressing, dead,
> align,
> > const_len, mergeable_load, const, ignored, multiple, with_arith, alloca,
loop,
> > store).
> 
> Hmm I'm not sure you need to have calls to all the intrinsics, but okay.
> 
> Eventually we will switch the default reader over to this one, and then the
> other tests will cover the same.
> 
> I think what would have been good to add is a test for a non-existent
intrinsic,
> or one with bad type signature.

I can't test a bad type signature, because llvm-as complains about this.
However, added file nacl-fake-intrinsic.ll that tests for a non-existent
intrinsic.

https://codereview.chromium.org/577353003/diff/20001/tests_lit/reader_tests/n...
File tests_lit/reader_tests/nacl-atomic-intrinsics.ll (right):

https://codereview.chromium.org/577353003/diff/20001/tests_lit/reader_tests/n...
tests_lit/reader_tests/nacl-atomic-intrinsics.ll:12: ;
https://code.google.com/p/nativeclient/issues/detail?id=3929
On 2014/09/18 23:43:53, jvoung wrote:
> You can remove this comment since you're not checking the x86-32 output (which
> this comment about the lock prefix applies to).

Done.

https://codereview.chromium.org/577353003/diff/20001/tests_lit/reader_tests/n...
tests_lit/reader_tests/nacl-atomic-intrinsics.ll:38: ; The PNaCl IR requires all
atomic accesses to be naturally aligned.
On 2014/09/18 23:43:53, jvoung wrote:
> You probably don't need this comment about x86.

Done.

https://codereview.chromium.org/577353003/diff/20001/tests_lit/reader_tests/n...
tests_lit/reader_tests/nacl-atomic-intrinsics.ll:663: ; CHECK-NEXT: entry:
On 2014/09/18 23:43:53, jvoung wrote:
> If you want, you only need the test_atomic_is_lock_free() and could skip the
> test_not_lock_free().

Removed.

https://codereview.chromium.org/577353003/diff/40001/src/IceConverter.cpp
File src/IceConverter.cpp (right):

https://codereview.chromium.org/577353003/diff/40001/src/IceConverter.cpp#new...
src/IceConverter.cpp:578: switch (I->validateCall(Call)) {
On 2014/09/18 23:43:53, jvoung wrote:
> It would be okay to have the index outparam version of validateCall() here?
Then
> you could report something more precise for WrongCallArgType and remove the
> extra wrapper version which ignores the outparam.

Done.

https://codereview.chromium.org/577353003/diff/40001/src/PNaClTranslator.cpp
File src/PNaClTranslator.cpp (right):

https://codereview.chromium.org/577353003/diff/40001/src/PNaClTranslator.cpp#...
src/PNaClTranslator.cpp:1876: // CALL has an explicit funtion address, while the
CALL_INDIRECT
On 2014/09/18 23:43:53, jvoung wrote:
> funtion -> function

Done.

https://codereview.chromium.org/577353003/diff/40001/src/PNaClTranslator.cpp#...
src/PNaClTranslator.cpp:1878: // looking up the type signature associated with
the funtion
On 2014/09/18 23:43:53, jvoung wrote:
> funtion -> function

Done.

https://codereview.chromium.org/577353003/diff/40001/src/PNaClTranslator.cpp#...
src/PNaClTranslator.cpp:1934: StrBuf << "Invalid PNaCL intrinsic call to " <<
Name;
On 2014/09/18 23:43:53, jvoung wrote:
> PNaCL -> PNaCl

Done.

https://codereview.chromium.org/577353003/diff/40001/src/PNaClTranslator.cpp#...
src/PNaClTranslator.cpp:1950: Ice::InstIntrinsicCall::create(Func, Values.size()
- ParamsStartIndex,
On 2014/09/18 23:43:53, jvoung wrote:
> "Values.size() - ParamsStartIndex" is the same as "NumParams"?

Done.

Powered by Google App Engine
This is Rietveld 408576698