File tree Expand file tree Collapse file tree 2 files changed +28
-2
lines changed Expand file tree Collapse file tree 2 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -2644,8 +2644,6 @@ ConstantInt *CallAnalyzer::stripAndComputeInBoundsConstantOffsets(Value *&V) {
2644
2644
if (!GEP->isInBounds () || !accumulateGEPOffset (*GEP, Offset))
2645
2645
return nullptr ;
2646
2646
V = GEP->getPointerOperand ();
2647
- } else if (Operator::getOpcode (V) == Instruction::BitCast) {
2648
- V = cast<Operator>(V)->getOperand (0 );
2649
2647
} else if (GlobalAlias *GA = dyn_cast<GlobalAlias>(V)) {
2650
2648
if (GA->isInterposable ())
2651
2649
break ;
Original file line number Diff line number Diff line change
1
+ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
2
+ ; RUN: opt -S -passes=inline < %s | FileCheck %s
3
+
4
+ ; Check that we don't crash when computing the
5
+ ; base pointer of `bitcast <1 x ptr> to ptr`
6
+
7
+ define void @caller (<1 x ptr > %x ) {
8
+ ; CHECK-LABEL: define void @caller(
9
+ ; CHECK-SAME: <1 x ptr> [[X:%.*]]) {
10
+ ; CHECK-NEXT: [[ENTRY:.*:]]
11
+ ; CHECK-NEXT: [[P:%.*]] = bitcast <1 x ptr> [[X]] to ptr
12
+ ; CHECK-NEXT: ret void
13
+ ;
14
+ entry:
15
+ %p = bitcast <1 x ptr > %x to ptr
16
+ call void @callee (ptr %p )
17
+ ret void
18
+ }
19
+
20
+ define void @callee (ptr %p ) {
21
+ ; CHECK-LABEL: define void @callee(
22
+ ; CHECK-SAME: ptr [[P:%.*]]) {
23
+ ; CHECK-NEXT: [[ENTRY:.*:]]
24
+ ; CHECK-NEXT: ret void
25
+ ;
26
+ entry:
27
+ ret void
28
+ }
You can’t perform that action at this time.
0 commit comments