LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 1304 - instcombine crash on extractelement from <1 x i64> type
Summary: instcombine crash on extractelement from <1 x i64> type
Status: RESOLVED FIXED
Alias: None
Product: libraries
Classification: Unclassified
Component: Scalar Optimizations (show other bugs)
Version: trunk
Hardware: All All
: P normal
Assignee: Chris Lattner
URL:
Keywords: compile-fail
Depends on:
Blocks:
 
Reported: 2007-04-04 02:32 PDT by Bill Wendling
Modified: 2010-02-22 12:47 PST (History)
1 user (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bill Wendling 2007-04-04 02:32:32 PDT
For this program:

$ cat b.ll
define i64 @bork(<2 x i64> %vec) {
entry:
  %tmp = extractelement <2 x i64> %vec, i32 0
  ret i64 %tmp
}

I get this abort:

$ llvm-as -f b.ll
$ opt -std-compile-opts -o a.bc -f b.bc
/Users/wendling/llvm/llvm.src/lib/Transforms/Scalar/InstructionCombining.cpp:1399: failed assertion 
`DemandedElts != EltMask && (DemandedElts & ~EltMask) == 0 && "Invalid DemandedElts!"'
Abort trap

If it's more than 1 element in the vector, you get the failure reported in PR1303.
Comment 1 Chris Lattner 2007-04-08 20:32:16 PDT
you attached the wrong testcase, you mean <1 x i64>
Comment 2 Chris Lattner 2007-04-08 20:38:52 PDT
Fixed, testcase here: Transforms/InstCombine/2007-04-08-SingleEltVectorCrash.ll

Patch here:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070402/047044.html

Thanks,

-Chris