diff options
| author | Andrew Trick <atrick@apple.com> | 2012-12-01 01:22:44 +0000 |
|---|---|---|
| committer | Andrew Trick <atrick@apple.com> | 2012-12-01 01:22:44 +0000 |
| commit | d5953622ce7ef8d505b1fc3969da8082377a6013 (patch) | |
| tree | 783130a525b2a4b6ad9a98d3021ebfc4c2fc697c /llvm | |
| parent | a01302182cbd145e880cd2a58d0bb76b50978d62 (diff) | |
| download | bcm5719-llvm-d5953622ce7ef8d505b1fc3969da8082377a6013.tar.gz bcm5719-llvm-d5953622ce7ef8d505b1fc3969da8082377a6013.zip | |
misched: Fix the DAG builder to handle an undef operand at ExitSU.
Assertion failed: (VNI && "No value to read by operand")
rdar://12790267.
llvm-svn: 169071
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/CodeGen/ScheduleDAGInstrs.cpp | 3 | ||||
| -rw-r--r-- | llvm/test/CodeGen/X86/misched-new.ll | 26 |
2 files changed, 28 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp b/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp index 2b00b596d3b..fd75576c786 100644 --- a/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp +++ b/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp @@ -210,7 +210,8 @@ void ScheduleDAGInstrs::addSchedBarrierDeps() { Uses[Reg].push_back(PhysRegSUOper(&ExitSU, -1)); else { assert(!IsPostRA && "Virtual register encountered after regalloc."); - addVRegUseDeps(&ExitSU, i); + if (MO.readsReg()) // ignore undef operands + addVRegUseDeps(&ExitSU, i); } } } else { diff --git a/llvm/test/CodeGen/X86/misched-new.ll b/llvm/test/CodeGen/X86/misched-new.ll index cec04b534fb..a39ea03af55 100644 --- a/llvm/test/CodeGen/X86/misched-new.ll +++ b/llvm/test/CodeGen/X86/misched-new.ll @@ -51,3 +51,29 @@ if.end: ; preds = %if.then, %entry } declare void @bar(i32,i32) + +; Test that the DAG builder can handle an undef vreg on ExitSU. +; CHECK: hasundef +; CHECK: call + +%t0 = type { i32, i32, i8 } +%t6 = type { i32 (...)**, %t7* } +%t7 = type { i32 (...)** } + +define void @hasundef() unnamed_addr uwtable ssp align 2 { + %1 = alloca %t0, align 8 + br i1 undef, label %3, label %2 + +; <label>:2 ; preds = %0 + unreachable + +; <label>:3 ; preds = %0 + br i1 undef, label %4, label %5 + +; <label>:4 ; preds = %3 + call void undef(%t6* undef, %t0* %1) + unreachable + +; <label>:5 ; preds = %3 + ret void +} |

