Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

Assertion `BestRC && "Couldn't find the register class"` #11515

Closed Quuxplusone closed 13 years ago

Quuxplusone commented 13 years ago
Bugzilla Link PR11342
Status RESOLVED FIXED
Importance P enhancement
Reported by Nick Lewycky (nlewycky@google.com)
Reported on 2011-11-08 15:50:33 -0800
Last modified on 2011-11-08 15:57:06 -0800
Version trunk
Hardware PC Linux
CC llvm-bugs@lists.llvm.org
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also
This testcase:

target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-
f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128"
target triple = "i386-unknown-linux-gnu"

define void @test(i64 %arg) {
entry:
  br i1 undef, label %if.end, label %if.else

if.else:
  %sub44 = sub i64 %arg, 0
  %tmp = load i32* undef, align 4
  %conv45 = sext i32 %tmp to i64
  %div = udiv i64 %sub44, %conv45
  %add46 = add i64 %div, 1
  %conv47 = trunc i64 %add46 to i32
  %add.ptr.i = getelementptr inbounds i8* null, i32 %conv47
  %rem = urem i64 %sub44, %conv45
  %conv56 = trunc i64 %rem to i32
  %sub58 = sub nsw i32 %tmp, %conv56
  br label %if.end

if.end:
  %pn1 = phi i8* [ %add.ptr.i, %if.else ], [ undef, %entry ]
  %pn2 = phi i32 [ %sub58, %if.else ], [ 0, %entry ]
  unreachable
}

causes this assert:

nlewycky@ducttape:~$ llvm/Debug+Asserts/bin/llc b.ll
llc: TargetRegisterInfo.cpp:68: const llvm::TargetRegisterClass
*llvm::TargetRegisterInfo::getMinimalPhysRegClass(unsigned int, llvm::EVT)
const: Assertion `BestRC && "Couldn't find the register class"' failed.
Quuxplusone commented 13 years ago

Fixed by Dan Gohman in r144123