diff options
| author | Zoran Jovanovic <zoran.jovanovic@imgtec.com> | 2017-08-10 10:27:29 +0000 |
|---|---|---|
| committer | Zoran Jovanovic <zoran.jovanovic@imgtec.com> | 2017-08-10 10:27:29 +0000 |
| commit | f4f2d084c6b94f6971233deadc301080e9ea8090 (patch) | |
| tree | 39ff81006ebf4e767b59c36907253464cb402ce4 /llvm/test/CodeGen/Mips/micromips-sizereduction | |
| parent | b7a38565385be7a03f26d60fd222af899b2daa69 (diff) | |
| download | bcm5719-llvm-f4f2d084c6b94f6971233deadc301080e9ea8090.tar.gz bcm5719-llvm-f4f2d084c6b94f6971233deadc301080e9ea8090.zip | |
[mips][microMIPS] Extending size reduction pass with XOR16
Author: milena.vujosevic.janicic
Reviewers: sdardis
The patch extends size reduction pass for MicroMIPS.
XOR instruction is transformed into 16-bit instruction XOR16, if possible.
Differential Revision: https://reviews.llvm.org/D34239
llvm-svn: 310579
Diffstat (limited to 'llvm/test/CodeGen/Mips/micromips-sizereduction')
| -rw-r--r-- | llvm/test/CodeGen/Mips/micromips-sizereduction/micromips-xor16.ll | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/Mips/micromips-sizereduction/micromips-xor16.ll b/llvm/test/CodeGen/Mips/micromips-sizereduction/micromips-xor16.ll new file mode 100644 index 00000000000..e953df62bf2 --- /dev/null +++ b/llvm/test/CodeGen/Mips/micromips-sizereduction/micromips-xor16.ll @@ -0,0 +1,14 @@ +; RUN: llc -march=mipsel -mcpu=mips32r2 -mattr=+micromips -verify-machineinstrs < %s | FileCheck %s + +; Function Attrs: nounwind readnone +define i1 @fun(i32 %a, i32 %b) { +entry: +; CHECK-LABEL: fun: +; CHECK: xor16 + %reg1 = or i32 %a, %b + %reg2 = xor i32 %reg1, -1 + %bool1 = icmp ne i32 %a, -1 + %bool1.ext = zext i1 %bool1 to i32 + %bool2 = icmp eq i32 %bool1.ext, %reg2 + ret i1 %bool2 +} |

