diff options
author | Hal Finkel <hfinkel@anl.gov> | 2012-08-28 02:10:33 +0000 |
---|---|---|
committer | Hal Finkel <hfinkel@anl.gov> | 2012-08-28 02:10:33 +0000 |
commit | 686f2ee226bb7f34425cb7c1c9c6e7546267625d (patch) | |
tree | 7198752cc6d7a9f4ff05e51ed7176551ecedc5d2 /llvm/test/CodeGen/PowerPC/remat-imm.ll | |
parent | b5d177e5b0a4a3bf7d8a96bbe637724e31d86d07 (diff) | |
download | bcm5719-llvm-686f2ee226bb7f34425cb7c1c9c6e7546267625d.tar.gz bcm5719-llvm-686f2ee226bb7f34425cb7c1c9c6e7546267625d.zip |
Allow remat of LI on PPC.
Allow load-immediates to be rematerialised in the register coalescer for
PPC. This makes test/CodeGen/PowerPC/big-endian-formal-args.ll fail,
because it relies on a register move getting emitted. The immediate load is
equivalent, so change this test case.
Patch by Tobias von Koch.
llvm-svn: 162727
Diffstat (limited to 'llvm/test/CodeGen/PowerPC/remat-imm.ll')
-rw-r--r-- | llvm/test/CodeGen/PowerPC/remat-imm.ll | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/PowerPC/remat-imm.ll b/llvm/test/CodeGen/PowerPC/remat-imm.ll new file mode 100644 index 00000000000..520921f57a9 --- /dev/null +++ b/llvm/test/CodeGen/PowerPC/remat-imm.ll @@ -0,0 +1,16 @@ +; RUN: llc < %s | FileCheck %s +; ModuleID = 'test.c' +target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v128:128:128-n32" +target triple = "powerpc-unknown-linux" + +@.str = private unnamed_addr constant [6 x i8] c"%d,%d\00", align 1 + +define i32 @main() nounwind { +entry: +; CHECK: li 4, 128 +; CHECK-NOT: mr 4, {{.*}} + %call = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([6 x i8]* @.str, i32 0, i32 0), i32 128, i32 128) nounwind + ret i32 0 +} + +declare i32 @printf(i8* nocapture, ...) nounwind |