[PATCH] D85689: [SanitizerCoverage] Use zeroext for cmp parameters on all targets
Ilya Leoshkevich via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 12 09:38:40 PDT 2020
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGf5a252ed681c: [SanitizerCoverage] Use zeroext for cmp parameters on all targets (authored by iii).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D85689/new/
https://reviews.llvm.org/D85689
Files:
compiler-rt/test/fuzzer/swap-cmp.test
llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
llvm/test/Instrumentation/SanitizerCoverage/cmp-tracing-api-x86_32.ll
Index: llvm/test/Instrumentation/SanitizerCoverage/cmp-tracing-api-x86_32.ll
===================================================================
--- llvm/test/Instrumentation/SanitizerCoverage/cmp-tracing-api-x86_32.ll
+++ llvm/test/Instrumentation/SanitizerCoverage/cmp-tracing-api-x86_32.ll
@@ -9,11 +9,15 @@
}
; CHECK-DAG: declare void @__sanitizer_cov_trace_pc_indir(i64)
-; CHECK-DAG: declare void @__sanitizer_cov_trace_cmp1(i8, i8)
-; CHECK-DAG: declare void @__sanitizer_cov_trace_cmp2(i16, i16)
-; CHECK-DAG: declare void @__sanitizer_cov_trace_cmp4(i32, i32)
+; CHECK-DAG: declare void @__sanitizer_cov_trace_cmp1(i8 zeroext, i8 zeroext)
+; CHECK-DAG: declare void @__sanitizer_cov_trace_cmp2(i16 zeroext, i16 zeroext)
+; CHECK-DAG: declare void @__sanitizer_cov_trace_cmp4(i32 zeroext, i32 zeroext)
; CHECK-DAG: declare void @__sanitizer_cov_trace_cmp8(i64, i64)
-; CHECK-DAG: declare void @__sanitizer_cov_trace_div4(i32)
+; CHECK-DAG: declare void @__sanitizer_cov_trace_const_cmp1(i8 zeroext, i8 zeroext)
+; CHECK-DAG: declare void @__sanitizer_cov_trace_const_cmp2(i16 zeroext, i16 zeroext)
+; CHECK-DAG: declare void @__sanitizer_cov_trace_const_cmp4(i32 zeroext, i32 zeroext)
+; CHECK-DAG: declare void @__sanitizer_cov_trace_const_cmp8(i64, i64)
+; CHECK-DAG: declare void @__sanitizer_cov_trace_div4(i32 zeroext)
; CHECK-DAG: declare void @__sanitizer_cov_trace_div8(i64)
; CHECK-DAG: declare void @__sanitizer_cov_trace_gep(i64)
; CHECK-DAG: declare void @__sanitizer_cov_trace_switch(i64, i64*)
Index: llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
===================================================================
--- llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
+++ llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
@@ -425,15 +425,13 @@
SanCovTracePCIndir =
M.getOrInsertFunction(SanCovTracePCIndirName, VoidTy, IntptrTy);
- // Make sure smaller parameters are zero-extended to i64 as required by the
- // x86_64 ABI.
+ // Make sure smaller parameters are zero-extended to i64 if required by the
+ // target ABI.
AttributeList SanCovTraceCmpZeroExtAL;
- if (TargetTriple.getArch() == Triple::x86_64) {
- SanCovTraceCmpZeroExtAL =
- SanCovTraceCmpZeroExtAL.addParamAttribute(*C, 0, Attribute::ZExt);
- SanCovTraceCmpZeroExtAL =
- SanCovTraceCmpZeroExtAL.addParamAttribute(*C, 1, Attribute::ZExt);
- }
+ SanCovTraceCmpZeroExtAL =
+ SanCovTraceCmpZeroExtAL.addParamAttribute(*C, 0, Attribute::ZExt);
+ SanCovTraceCmpZeroExtAL =
+ SanCovTraceCmpZeroExtAL.addParamAttribute(*C, 1, Attribute::ZExt);
SanCovTraceCmpFunction[0] =
M.getOrInsertFunction(SanCovTraceCmp1, SanCovTraceCmpZeroExtAL, VoidTy,
@@ -458,8 +456,7 @@
{
AttributeList AL;
- if (TargetTriple.getArch() == Triple::x86_64)
- AL = AL.addParamAttribute(*C, 0, Attribute::ZExt);
+ AL = AL.addParamAttribute(*C, 0, Attribute::ZExt);
SanCovTraceDivFunction[0] =
M.getOrInsertFunction(SanCovTraceDiv4, AL, VoidTy, IRB.getInt32Ty());
}
Index: compiler-rt/test/fuzzer/swap-cmp.test
===================================================================
--- compiler-rt/test/fuzzer/swap-cmp.test
+++ compiler-rt/test/fuzzer/swap-cmp.test
@@ -1,5 +1,3 @@
-# FIXME: Fails to find BINGO with ASAN on s390x, work fine without ASAN.
-XFAIL: s390x
RUN: %cpp_compiler %S/SwapCmpTest.cpp -o %t-SwapCmpTest
CHECK: BINGO
RUN: not %run %t-SwapCmpTest -seed=1 -runs=10000000 2>&1 | FileCheck %s
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D85689.285120.patch
Type: text/x-patch
Size: 3502 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200812/737bff86/attachment-0001.bin>
More information about the llvm-commits
mailing list