Skip to content

Commit 0d95631

Browse files
authored
[msan] Handle llvm.[us]cmp (starship operator) (#125804)
Apply handleShadowOr to llvm.[us]cmp. Previously, llvm.[su]cmp was correctly handled heuristically when each parameter type is the same as the return type (e.g., `call i8 @llvm.ucmp.i8.i8(i8 %x, i8 %y)`) but handled incorrectly by visitInstruction when the return type is different e.g., (`call i8 @llvm.ucmp.i8.i62(i62 %x, i62 %y)`, `call <4 x i8> @llvm.ucmp.v4i8.v4i32(<4 x i32> %x, <4 x i32> %y)`). Updates the tests from #125790
1 parent e9e6ba6 commit 0d95631

File tree

3 files changed

+154
-353
lines changed

3 files changed

+154
-353
lines changed

llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4945,6 +4945,12 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
49454945
break;
49464946
}
49474947

4948+
case Intrinsic::scmp:
4949+
case Intrinsic::ucmp: {
4950+
handleShadowOr(I);
4951+
break;
4952+
}
4953+
49484954
default:
49494955
if (!handleUnknownIntrinsic(I))
49504956
visitInstruction(I);

0 commit comments

Comments
 (0)