diff options
| author | JF Bastien <jfb@google.com> | 2015-01-14 05:24:33 +0000 |
|---|---|---|
| committer | JF Bastien <jfb@google.com> | 2015-01-14 05:24:33 +0000 |
| commit | eeea8970b4b12b5493d603ceff960e4b19296c1f (patch) | |
| tree | e30fa1f843360c8d3ff56cff381809f7962d7851 /llvm/test/CodeGen | |
| parent | c7af264486c3039bfbdcbbc027ba3e3b2b3f37d2 (diff) | |
| download | bcm5719-llvm-eeea8970b4b12b5493d603ceff960e4b19296c1f.tar.gz bcm5719-llvm-eeea8970b4b12b5493d603ceff960e4b19296c1f.zip | |
Revert "Insert random noops to increase security against ROP attacks (llvm)"
This reverts commit:
http://reviews.llvm.org/D3392
llvm-svn: 225948
Diffstat (limited to 'llvm/test/CodeGen')
| -rw-r--r-- | llvm/test/CodeGen/Mips/noop-insert.ll | 26 | ||||
| -rw-r--r-- | llvm/test/CodeGen/PowerPC/noop-insert.ll | 31 | ||||
| -rw-r--r-- | llvm/test/CodeGen/X86/noop-insert-percentage.ll | 68 | ||||
| -rw-r--r-- | llvm/test/CodeGen/X86/noop-insert.ll | 48 |
4 files changed, 0 insertions, 173 deletions
diff --git a/llvm/test/CodeGen/Mips/noop-insert.ll b/llvm/test/CodeGen/Mips/noop-insert.ll deleted file mode 100644 index f6e0f2b6b09..00000000000 --- a/llvm/test/CodeGen/Mips/noop-insert.ll +++ /dev/null @@ -1,26 +0,0 @@ -; RUN: llc < %s -march=mips -noop-insertion | FileCheck %s -; RUN: llc < %s -march=mips -noop-insertion -rng-seed=1 | FileCheck %s --check-prefix=SEED1 -; RUN: llc < %s -march=mips -noop-insertion -noop-insertion-percentage=100 | FileCheck %s --check-prefix=100PERCENT - -; This test case checks that NOOPs are inserted correctly for MIPS. - -; It just happens that with a default percentage of 25% and seed=0, -; no NOOPs are inserted. -; CHECK: mul -; CHECK-NEXT: jr - -; SEED1: nop -; SEED1-NEXT: mul -; SEED1-NEXT: jr - -; 100PERCENT: nop -; 100PERCENT-NEXT: mul -; 100PERCENT-NEXT: nop -; 100PERCENT-NEXT: jr - -define i32 @test1(i32 %x, i32 %y, i32 %z) { -entry: - %tmp = mul i32 %x, %y - %tmp2 = add i32 %tmp, %z - ret i32 %tmp2 -} diff --git a/llvm/test/CodeGen/PowerPC/noop-insert.ll b/llvm/test/CodeGen/PowerPC/noop-insert.ll deleted file mode 100644 index ac8f744919a..00000000000 --- a/llvm/test/CodeGen/PowerPC/noop-insert.ll +++ /dev/null @@ -1,31 +0,0 @@ -; RUN: llc < %s -march=ppc32 -mcpu=g4 -noop-insertion | FileCheck %s -; RUN: llc < %s -march=ppc32 -mcpu=g4 -noop-insertion -rng-seed=1 | FileCheck %s --check-prefix=SEED1 -; RUN: llc < %s -march=ppc32 -mcpu=g4 -noop-insertion -noop-insertion-percentage=100 | FileCheck %s --check-prefix=100PERCENT - -; This test case checks that NOOPs are inserted correctly for PowerPC. - -; It just happens that with a default percentage of 25% and seed=0, -; no NOOPs are inserted. -; CHECK: mullw -; CHECK-NEXT: add -; CHECK-NEXT: blr - -; SEED1: nop -; SEED1-NEXT: mullw -; SEED1-NEXT: add -; SEED1-NEXT: nop -; SEED1-NEXT: blr - -; 100PERCENT: nop -; 100PERCENT-NEXT: mullw -; 100PERCENT-NEXT: nop -; 100PERCENT-NEXT: add -; 100PERCENT-NEXT: nop -; 100PERCENT-NEXT: blr - -define i32 @test1(i32 %x, i32 %y, i32 %z) { -entry: - %tmp = mul i32 %x, %y - %tmp2 = add i32 %tmp, %z - ret i32 %tmp2 -} diff --git a/llvm/test/CodeGen/X86/noop-insert-percentage.ll b/llvm/test/CodeGen/X86/noop-insert-percentage.ll deleted file mode 100644 index f828d2985ea..00000000000 --- a/llvm/test/CodeGen/X86/noop-insert-percentage.ll +++ /dev/null @@ -1,68 +0,0 @@ -; REQUIRES: disabled - -; RUN: llc < %s -mtriple=x86_64-linux -rng-seed=5 -noop-insertion -noop-insertion-percentage=10 \ -; RUN: | FileCheck %s --check-prefix=PERCENT10 -; RUN: llc < %s -mtriple=x86_64-linux -rng-seed=5 -noop-insertion -noop-insertion-percentage=50 \ -; RUN: | FileCheck %s --check-prefix=PERCENT50 -; RUN: llc < %s -mtriple=x86_64-linux -rng-seed=5 -noop-insertion -noop-insertion-percentage=100 \ -; RUN: | FileCheck %s --check-prefix=PERCENT100 - -; RUN: llc < %s -march=x86 -rng-seed=5 -noop-insertion -noop-insertion-percentage=100 \ -; RUN: | FileCheck %s --check-prefix=X86-PERCENT100 - -; This test case tests NOOP insertion at varying percentage levels. - -define i32 @test(i32 %x, i32 %y, i32 %z) { -entry: - %t1 = add i32 %x, %y - %t2 = mul i32 %t1, %z - %t3 = add i32 %t2, %x - %t4 = mul i32 %t3, %z - %t5 = add i32 %t4, %x - %t6 = mul i32 %t5, %z - %t7 = add i32 %t6, %x - %t8 = mul i32 %t7, %z - %t9 = add i32 %t8, %x - %t10 = mul i32 %t9, %z - %t11 = add i32 %t10, %x - ret i32 %t11 -} - -; PERCENT10: movq %rbp, %rbp -; PERCENT10: retq - -; PERCENT50: leaq (%rdi), %rdi -; PERCENT50: nop -; PERCENT50: movq %rbp, %rbp -; PERCENT50: movq %rsp, %rsp -; PERCENT50: leaq (%rsi), %rsi -; PERCENT50: nop -; PERCENT50: retq - -; PERCENT100: leaq (%rdi), %rdi -; PERCENT100: leaq (%rdi), %rdi -; PERCENT100: nop -; PERCENT100: movq %rbp, %rbp -; PERCENT100: movq %rsp, %rsp -; PERCENT100: nop -; PERCENT100: nop -; PERCENT100: leaq (%rsi), %rsi -; PERCENT100: nop -; PERCENT100: leaq (%rdi), %rdi -; PERCENT100: leaq (%rdi), %rdi -; PERCENT100: leaq (%rsi), %rsi -; PERCENT100: retq - - -; X86-PERCENT100: leal (%edi), %edi -; X86-PERCENT100: leal (%edi), %edi -; X86-PERCENT100: nop -; X86-PERCENT100: movl %ebp, %ebp -; X86-PERCENT100: movl %esp, %esp -; X86-PERCENT100: nop -; X86-PERCENT100: nop -; X86-PERCENT100: leal (%esi), %esi -; X86-PERCENT100: nop -; X86-PERCENT100: leal (%edi), %edi -; X86-PERCENT100: leal (%edi), %edi -; X86-PERCENT100: leal (%esi), %esi diff --git a/llvm/test/CodeGen/X86/noop-insert.ll b/llvm/test/CodeGen/X86/noop-insert.ll deleted file mode 100644 index 47ecf0bf9f7..00000000000 --- a/llvm/test/CodeGen/X86/noop-insert.ll +++ /dev/null @@ -1,48 +0,0 @@ -; REQUIRES: disabled - -; RUN: llc < %s -mtriple=x86_64-linux -noop-insertion | FileCheck %s -; RUN: llc < %s -mtriple=x86_64-linux -noop-insertion -rng-seed=1 | FileCheck %s --check-prefix=SEED1 -; RUN: llc < %s -mtriple=x86_64-linux -noop-insertion -rng-seed=20 | FileCheck %s --check-prefix=SEED2 -; RUN: llc < %s -mtriple=x86_64-linux -noop-insertion -rng-seed=500 | FileCheck %s --check-prefix=SEED3 - -; RUN: llc < %s -march=x86 -noop-insertion | FileCheck %s --check-prefix=x86_32 - -; This test case checks that NOOPs are inserted, and that the RNG seed -; affects both the placement (position of imull) and choice of these NOOPs. - -; It just happens that with a default percentage of 25% and seed=0, -; no NOOPs are inserted. -; CHECK: imull -; CHECK-NEXT: leal -; CHECK-NEXT: retq -; CHECK-NOT: nop - -; SEED1: leaq (%rsi), %rsi -; SEED1-NEXT: imull -; SEED1-NEXT: leal -; SEED1-NEXT: retq - -; SEED2: imull -; SEED2-NEXT: movq %rsp, %rsp -; SEED2-NEXT: leal -; SEED2-NEXT: retq - -; SEED3: imull -; SEED3-NEXT: movq %rsp, %rsp -; SEED3-NEXT: leal -; SEED3-NEXT: leaq (%rdi), %rdi -; SEED3-NEXT: retq - -; The operand of the following is used to distinguish from a movl NOOP -; x86_32: movl 4(%esp), -; x86_32-NEXT: imull -; x86_32-NEXT: addl -; x86_32-NEXT: movl %esp, %esp -; x86_32-NEXT: retl - -define i32 @test1(i32 %x, i32 %y, i32 %z) { -entry: - %tmp = mul i32 %x, %y - %tmp2 = add i32 %tmp, %z - ret i32 %tmp2 -} |

