This is a precursor to the general eager-checks patch.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp | ||
---|---|---|
1152 | this can be improved now by moving the origin update code behind the shadow check | |
1397 | extra "ShadowItem =" | |
1398 | I don't think this is possible | |
1401 | I'd prefer if this generated less pointless comparisons. It would be nice if CreateICmpNE(i1 x, i1 false) automatically folded to "x". I think this is a reasonable change to make in IRBuilder, even though this is probably a very unlikely situation. As an alternative, make convertShadowToScalar return i1 and remove icmp in the callers (call it something like convertShadowToBool). Check Combiner class how not to emit a "false" constant. As for the Maybe* callers, it's ok to not handle aggregates there. |
llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp | ||
---|---|---|
1152 | This check covers arrays as well, so I don't think I can get rid of it completely but I can change it to check for isArrayType(). I wrote some code to let convertShadowToScalar handle Array types as well, but I thought I would leave that to a separate patch. |
llvm/test/Instrumentation/MemorySanitizer/check-struct.ll | ||
---|---|---|
10 | As far as I can tell it's passing without assertions enabled, yeah. |
LGTM with 2 comments
llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp | ||
---|---|---|
1392–1418 | Mention that the result may not be the same bit width as the original type in the comment (this is the usual property of shadow types). | |
llvm/test/Instrumentation/MemorySanitizer/check-struct.ll | ||
20 | could this line say ; CHECK: br i1 [[F1_OR]] ? |
llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp | ||
---|---|---|
1429 | If you look at msan_x86_bts_asm.ll, this check eliminates an unnecessary icmp in some cases. |
this can be improved now by moving the origin update code behind the shadow check