New user self-registration is disabled due to spam. For an account please email bugs-admin@lists.llvm.org with your e-mail address and full name.

Bug 42585 - SROA assert fails VTy == CandidateTys[0] && "Different vector types with the same element type!
Summary: SROA assert fails VTy == CandidateTys[0] && "Different vector types with the ...
Status: RESOLVED FIXED
Alias: None
Product: libraries
Classification: Unclassified
Component: Scalar Optimizations (show other bugs)
Version: trunk
Hardware: PC Linux
: P normal
Assignee: Chandler Carruth
URL:
Keywords:
Depends on:
Blocks: release-9.0.1
  Show dependency tree
 
Reported: 2019-07-11 08:14 PDT by Felipe de Azevedo Piovezan
Modified: 2019-12-11 11:09 PST (History)
6 users (show)

See Also:
Fixed By Commit(s): r372480 f2c8771


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Felipe de Azevedo Piovezan 2019-07-11 08:14:43 PDT
The following IR causes SROA to assert a failure. Verified this on a trunk build with asserts on.

opt test.ll -sroa

target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-n8:16:32:64"

define <4 x i1> @vector_bitcast() {
  ; CHECK-LABEL: @vector_bitcast

    %a = alloca <3 x i1>
    store <3 x i1> <i1 1,i1 0,i1 1>, <3 x i1>* %a
    %cast = bitcast <3 x i1>* %a to <4 x i1>*
    %vec = load <4 x i1>, <4 x i1>* %cast
    ret <4 x i1> %vec
}
Comment 1 sguelton 2019-08-30 01:25:51 PDT
Should be fixed by https://reviews.llvm.org/D66790
Comment 2 sguelton 2019-09-24 01:25:02 PDT
Fixed by https://reviews.llvm.org/rL372480
Comment 3 Luke 2019-09-28 07:20:54 PDT
Reopening to track merging to 9.0.1.
Comment 4 Tom Stellard 2019-11-25 09:19:35 PST
Chandler, are you OK with merging this?

https://reviews.llvm.org/rL372480
Comment 5 Chandler Carruth 2019-12-08 03:00:14 PST
(In reply to Tom Stellard from comment #4)
> Chandler, are you OK with merging this?
> 
> https://reviews.llvm.org/rL372480

LGTM for merge (sorry for delay seeing this).
Comment 6 Tom Stellard 2019-12-11 11:09:56 PST
Merged: f2c8771