This is an archive of the discontinued LLVM Phabricator instance.

[MSan][LLVM][MIPS] Shadow and Origin offsets for MIPS
ClosedPublic

Authored by mohit.bhakkad on Nov 6 2014, 2:37 AM.

Details

Diff Detail

Repository
rL LLVM

Event Timeline

mohit.bhakkad retitled this revision from to [MSan][LLVM][MIPS] Shadow and Origin offsets for MIPS.
mohit.bhakkad updated this object.
mohit.bhakkad edited the test plan for this revision. (Show Details)
mohit.bhakkad added reviewers: eugenis, kcc, samsonov, petarj.
mohit.bhakkad set the repository for this revision to rL LLVM.
mohit.bhakkad added subscribers: dsanders, sdkie, slthakur, Unknown Object (MLST).
kcc added inline comments.Nov 19 2014, 1:03 PM
lib/Transforms/Instrumentation/MemorySanitizer.cpp
128 ↗(On Diff #15847)

I'd prefer not to have any more 32-bit here for now,
at least until we have 32-bit msan on x86

453 ↗(On Diff #15847)

add an else statement with

report_fatal_error("unsupported triple");
mohit.bhakkad set the repository for this revision to rL LLVM.

Changes in this revision:

  • Removed mips32 related changes.
  • added fatal_error report for unsupported triplets.

Without this patch and http://reviews.llvm.org/D6147, mips64 in compiler-rt won't build.
I have removed all msan32 related changes, please let me know if any other changes are needed.

eugenis accepted this revision.Nov 27 2014, 6:35 AM
eugenis edited edge metadata.

LGTM w/ nit

lib/Transforms/Instrumentation/MemorySanitizer.cpp
123 ↗(On Diff #16556)

Please change it to kX86_64ShadowMask, kX86ShadowMask, etc (the same for origin offset below).

125 ↗(On Diff #16556)

No need for the "64" suffix, it already says "MIPS64".

This revision is now accepted and ready to land.Nov 27 2014, 6:35 AM
mohit.bhakkad edited edge metadata.
mohit.bhakkad set the repository for this revision to rL LLVM.

Changes in this revision:

  • Changed names of flags as suggested

LGTM with 1 more comment

lib/Transforms/Instrumentation/MemorySanitizer.cpp
125 ↗(On Diff #16724)

Please remove the extra underscore after MIPS64 and change the constant to 1ULL << (something) for consistency.

mohit.bhakkad set the repository for this revision to rL LLVM.

Changes in this revision:
-Removed the extra underscore after MIPS64 in names of constants.
-Changed the constants to 1ULL << (something) format.

samsonov added inline comments.Dec 9 2014, 12:09 PM
lib/Transforms/Instrumentation/MemorySanitizer.cpp
401 ↗(On Diff #16756)

You can get rid of the PtrSize completely. Just make a single switch on M.getTrargetTriple().getArch() to choose between x86, x86_64 and MIPS.

Mohit, I've committed D6666 so your patch may need some rework. Note that the patch committed does not include the improvements suggested for this patch like reporting unsupported triples. We probably should replace the references to the unsupported 32-bit memory map descriptors with null pointers and check them in doInitialization(). It's OK to remove the 32-bit descriptor for FreeBSD as it is not actually supported anyway.

mohit.bhakkad planned changes to this revision.Dec 19 2014, 1:43 AM
mohit.bhakkad set the repository for this revision to rL LLVM.

Changes in this revision:

  • Updated the patch in order to match with Viktor's commit.
  • Some changes in names for distinction.
  • Replaced PtrSize switch case with switch case for OS and Archs as suggested by Alexey.
This revision is now accepted and ready to land.Dec 29 2014, 5:35 AM
mohit.bhakkad requested a review of this revision.Dec 29 2014, 11:16 PM
mohit.bhakkad edited edge metadata.

Hi @eugenis, @samsonov

This patch is important one for msan to work on MIPS, please let me know if any suggestions/changes in this revision.

eugenis accepted this revision.Jan 20 2015, 12:53 AM
eugenis edited edge metadata.

Do you have commit access? (i.e. should I land this change?)

lib/Transforms/Instrumentation/MemorySanitizer.cpp
251 ↗(On Diff #17668)

Let's call it "X86" instead of "INTEL".

This revision is now accepted and ready to land.Jan 20 2015, 12:53 AM

Do you have commit access? (i.e. should I land this change?)

Yes, I have commit access, will commit it after doing suggested change.

mohit.bhakkad edited edge metadata.

Changes in this Revision:

  • Changed "INTEL" to "X86".
This revision was automatically updated to reflect the committed changes.