[PATCH] D21395: Fix for Bug 28144
Vivek Pandya via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 21 12:26:51 PDT 2016
vivekvpandya updated this revision to Diff 61424.
vivekvpandya added a comment.
I think now this is in good shape. I don't have commit access so if this is ok now then please commit it.
http://reviews.llvm.org/D21395
Files:
lib/CodeGen/RegUsageInfoCollector.cpp
test/CodeGen/X86/ipra-reg-usage.ll
Index: test/CodeGen/X86/ipra-reg-usage.ll
===================================================================
--- test/CodeGen/X86/ipra-reg-usage.ll
+++ test/CodeGen/X86/ipra-reg-usage.ll
@@ -3,7 +3,7 @@
target triple = "x86_64-unknown-unknown"
declare void @bar1()
define preserve_allcc void @foo()#0 {
-; CHECK: foo Clobbered Registers: EFLAGS YMM0 YMM1 YMM2 YMM3 YMM4 YMM5 YMM6 YMM7 YMM8 YMM9 YMM10 YMM11 YMM12 YMM13 YMM14 YMM15 ZMM0 ZMM1 ZMM2 ZMM3 ZMM4 ZMM5 ZMM6 ZMM7 ZMM8 ZMM9 ZMM10 ZMM11 ZMM12 ZMM13 ZMM14 ZMM15
+; CHECK: foo Clobbered Registers: EFLAGS FS CR10 K2 YMM0 YMM1 YMM2 YMM3 YMM4 YMM5 YMM6 YMM7 YMM8 YMM9 YMM10 YMM11 YMM12 YMM13 YMM14 YMM15 ZMM0 ZMM1 ZMM2 ZMM3 ZMM4 ZMM5 ZMM6 ZMM7 ZMM8 ZMM9 ZMM10 ZMM11 ZMM12 ZMM13 ZMM14 ZMM15
call void @bar1()
call void @bar2()
ret void
Index: lib/CodeGen/RegUsageInfoCollector.cpp
===================================================================
--- lib/CodeGen/RegUsageInfoCollector.cpp
+++ lib/CodeGen/RegUsageInfoCollector.cpp
@@ -1,4 +1,4 @@
-//===- RegUsageInfoCollector.cpp - Register Usage Informartion Collector --===//
+//===-- RegUsageInfoCollector.cpp - Register Usage Information Collector --===//
//
// The LLVM Compiler Infrastructure
//
@@ -110,6 +110,10 @@
if (!MRI->reg_nodbg_empty(PReg) && MRI->isPhysRegUsed(PReg))
markRegClobbered(TRI, &RegMask[0], PReg);
+ BitVector UsedPhysRegMask = MRI->getUsedPhysRegsMask();
+ for (unsigned i = 0; i < RegMaskSize; ++i)
+ RegMask[i] &= ~UsedPhysRegMask[i];
+
const uint32_t *CallPreservedMask =
TRI->getCallPreservedMask(MF, MF.getFunction()->getCallingConv());
// Set callee saved register as preserved.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21395.61424.patch
Type: text/x-patch
Size: 1686 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160621/585205f2/attachment.bin>
More information about the llvm-commits
mailing list