[LLVMdev] SDIV >128bit, DAG->DAG error in LegalizeIntegerTypes

edA-qa mort-ora-y eda-qa at disemia.com
Sat Sep 28 22:24:17 PDT 2013


I'm getting the following error when trying to SDIV integers greater
than 128bit (on an AMD64 target).

LegalizeIntegerTypes.cpp:2047: void
llvm::DAGTypeLegalizer::ExpandIntRes_SDIV(llvm::SDNode*, llvm::SDValue&,
llvm::SDValue&): Assertion `LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported
SDIV!"' failed.
Stack dump:
0.      Running pass 'X86 DAG->DAG Instruction Selection' on function
'@_entry'

However, not all SDIV on such integers fails, the below works:

@a = global i200 undef
@b = global i64 undef

define void @_entry() {
entry:
  store i200 200, i200* @a
  %0 = load i200* @a
  %1 = load i200* @a
  %2 = sdiv i200 %0, %1
  %3 = trunc i200 %2 to i64
  store i64 %3, i64* @b
  %4 = load i64* @b
  call void @trace_integer(i64 %4)
  ret void
}


Yet with a simple addition (the same SDIV) it fails:

define void @_entry() {
entry:
  store i200 200, i200* @a
  %0 = load i200* @a
  %1 = load i200* @a
  %2 = sdiv i200 %0, %1
  %3 = trunc i200 %2 to i64
  store i64 %3, i64* @b
  %4 = load i200* @a
  %5 = load i200* @a
  %6 = sdiv i200 %4, %5
  store i200 %6, i200* @a
  ret void
}


I just upgraded to LLVM 3.3 to ensure it wasn't a 3.2 oddity. The
problem persists in 3.3.

-- 
edA-qa mort-ora-y
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Sign: Please digitally sign your emails.
Encrypt: I'm also happy to receive encrypted mail.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 263 bytes
Desc: OpenPGP digital signature
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130929/8a5e150d/attachment.sig>


More information about the llvm-dev mailing list