[PATCH] D88519: [NFC][MSAN] Extract llvm.abs handling into a function
Vitaly Buka via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 2 15:01:43 PDT 2020
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGaff896dea13f: [NFC][MSAN] Extract llvm.abs handling into a function (authored by vitalybuka).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D88519/new/
https://reviews.llvm.org/D88519
Files:
llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
Index: llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
===================================================================
--- llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
+++ llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
@@ -2638,12 +2638,6 @@
return false;
unsigned NumArgOperands = I.getNumArgOperands();
- if (I.getIntrinsicID() == Intrinsic::abs) {
- assert(NumArgOperands == 2);
- // The last argument is just a boolean flag.
- NumArgOperands = 1;
- }
-
for (unsigned i = 0; i < NumArgOperands; ++i) {
Type *Ty = I.getArgOperand(i)->getType();
if (Ty != RetTy)
@@ -3236,8 +3230,24 @@
setOriginForNaryOp(I);
}
+ // Instrument abs intrinsic.
+ // handleUnknownIntrinsic can't handle it because of the last
+ // is_int_min_poison argument which does not match the result type.
+ void handleAbsIntrinsic(IntrinsicInst &I) {
+ assert(I.getType()->isIntOrIntVectorTy());
+ assert(I.getArgOperand(0)->getType() == I.getType());
+
+ // FIXME: Handle is_int_min_poison.
+ IRBuilder<> IRB(&I);
+ setShadow(&I, getShadow(&I, 0));
+ setOrigin(&I, getOrigin(&I, 0));
+ }
+
void visitIntrinsicInst(IntrinsicInst &I) {
switch (I.getIntrinsicID()) {
+ case Intrinsic::abs:
+ handleAbsIntrinsic(I);
+ break;
case Intrinsic::lifetime_start:
handleLifetimeStart(I);
break;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88519.295918.patch
Type: text/x-patch
Size: 1416 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201002/10a6143a/attachment.bin>
More information about the llvm-commits
mailing list