This is an archive of the discontinued LLVM Phabricator instance.

Add msan custom mapping options
ClosedPublic

Authored by vit9696 on Mar 27 2018, 6:24 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

vit9696 created this revision.Mar 27 2018, 6:24 AM
eugenis added inline comments.Mar 27 2018, 2:30 PM
lib/Transforms/Instrumentation/MemorySanitizer.cpp
610

This getNumOccurrences() check and the 3 checks below are unnecessary.

618

I feel uneasy about modifying global Custom_MemoryMapParams in module-specific initialization. Sure, it will be the same for each module, and it is determined by global cl:opt values anyway, but lets move it inside class MemorySanitizer to be on the safe side.

test/Instrumentation/MemorySanitizer/manual-shadow.ll
4

that's a lot of -msan flags

6

Could you make the numbers decimal so they can be easily recognized in the IR?

7

Please add a test for origin-base.

vit9696 updated this revision to Diff 140057.Mar 28 2018, 3:38 AM

Thanks for the review. We are good now, I suppose. Could you merge it for me please?

eugenis accepted this revision.Mar 28 2018, 2:04 PM

Sure. There is still a few extra -msan flags in the tests, I can remove them before commit.

This revision is now accepted and ready to land.Mar 28 2018, 2:04 PM
eugenis requested changes to this revision.Mar 28 2018, 2:16 PM

Actually, no. The test does not pass, not even close.
This check:

; CHECK-BASE-NOT: ret

is tripped by this line:

call void @__msan_warning_noreturn()

This check:

; CHECK-BASE: load{{.*}}3735928559

does not match because we never load from shadow base; we use it in "add".

Please make sure the test passes.

This revision now requires changes to proceed.Mar 28 2018, 2:16 PM

Hm, I did run tests before uploading the diff and they passed. Perhaps I upped the wrong file. I will recheck tomorrow and resubmit.

vit9696 updated this revision to Diff 140184.Mar 28 2018, 8:25 PM

Morning. Ok, it looks like I hardly checked the IR and a ton of passes were left unnoticed making no sense of the tests :D. Sorry, fixed.

eugenis accepted this revision.Mar 29 2018, 2:15 PM

Oh, right. And I removed the extra -msan flags before running the tests. It means you were testing msan^3 before :)

This revision is now accepted and ready to land.Mar 29 2018, 2:15 PM
This revision was automatically updated to reflect the committed changes.