llvm/test/Instrumentation
Alexander Potapenko a0d77192f6 [msan] Fix PR32842
It turned out that MSan was incorrectly calculating the shadow for int comparisons: it was done by truncating the result of (Shadow1 OR Shadow2) to i1, effectively rendering all bits except LSB useless.
This approach doesn't work e.g. in the case where the values being compared are even (i.e. have the LSB of the shadow equal to zero).
Instead, if CreateShadowCast() has to cast a bigger int to i1, we replace the truncation with an ICMP to 0.

This patch doesn't affect the code generated for SPEC 2006 binaries, i.e. there's no performance impact.

For the test case reported in PR32842 MSan with the patch generates a slightly more efficient code:

  orq     %rcx, %rax
  jne     .LBB0_6
, instead of:

  orl     %ecx, %eax
  testb   $1, %al
  jne     .LBB0_6




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302787 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-11 11:07:48 +00:00
..
AddressSanitizer [asan] Fix dead stripping of globals on Linux. 2017-04-27 20:27:27 +00:00
BoundsChecking
DataFlowSanitizer
EfficiencySanitizer [EfficiencySanitizer] Using '$' instead of '#' for struct counter name 2016-09-22 08:33:06 +00:00
InstrProfiling [Profile] PE binary coverage bug fix 2017-04-13 23:37:12 +00:00
MemorySanitizer [msan] Fix PR32842 2017-05-11 11:07:48 +00:00
SanitizerCoverage [sanitizer-coverage] remove some more stale code 2017-04-19 22:42:11 +00:00
ThreadSanitizer ThreadSanitizer: don't track swifterror memory addresses 2017-02-15 18:57:06 +00:00