From 87048a4c9eb1b74548a9ab5c6c7717ae3be80bbd Mon Sep 17 00:00:00 2001 From: Reed Kotler Date: Thu, 7 Aug 2014 22:09:01 +0000 Subject: fix materialization of one bit constants and global values which are accessed through a base GOT entry. Summary: get tip of tree mips fast-isel to pass test-suite Two bugs were fixed: 1) one bit booleans were treated as 1 bit signed integers and so the literal '1' could become sign extended. 2) mips uses got for pic but in certain cases, as with string constants for example, many items can be referenced from the same got entry and this case was not handled properly. Test Plan: test-suite Reviewers: dsanders Reviewed By: dsanders Subscribers: mcrosier Differential Revision: http://reviews.llvm.org/D4801 llvm-svn: 215155 --- llvm/test/CodeGen/Mips/Fast-ISel/loadstrconst.ll | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 llvm/test/CodeGen/Mips/Fast-ISel/loadstrconst.ll (limited to 'llvm/test/CodeGen/Mips/Fast-ISel/loadstrconst.ll') diff --git a/llvm/test/CodeGen/Mips/Fast-ISel/loadstrconst.ll b/llvm/test/CodeGen/Mips/Fast-ISel/loadstrconst.ll new file mode 100644 index 00000000000..b32e85751da --- /dev/null +++ b/llvm/test/CodeGen/Mips/Fast-ISel/loadstrconst.ll @@ -0,0 +1,19 @@ +; RUN: llc -march=mipsel -relocation-model=pic -O0 -mips-fast-isel -fast-isel-abort -mcpu=mips32r2 \ +; RUN: < %s | FileCheck %s + +@.str = private unnamed_addr constant [6 x i8] c"hello\00", align 1 +@s = common global i8* null, align 4 + +; Function Attrs: nounwind +define void @foo() #0 { +entry: + store i8* getelementptr inbounds ([6 x i8]* @.str, i32 0, i32 0), i8** @s, align 4 + ret void +; CHECK: .ent foo +; CHECK: lw $[[REG1:[0-9]+]], %got($.str)(${{[0-9]+}}) +; CHECK: addiu ${{[0-9]+}}, $[[REG1]], %lo($.str) + +} + +attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } + -- cgit v1.2.3