Skip to content

Commit 17fec8a

Browse files
nikicjoaosaffran
authored and
joaosaffran
committed
[IR] Remove mul constant expression (llvm#127046)
Remove support for the mul constant expression, which has previously already been marked as undesirable. This removes the APIs to create mul expressions and updates tests to stop using mul expressions. Part of: https://discourse.llvm.org/t/rfc-remove-most-constant-expressions/63179
1 parent 3762f9f commit 17fec8a

31 files changed

+64
-174
lines changed

llvm/bindings/ocaml/llvm/llvm.ml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -655,9 +655,6 @@ external const_nuw_add : llvalue -> llvalue -> llvalue = "llvm_const_nuw_add"
655655
external const_sub : llvalue -> llvalue -> llvalue = "llvm_const_sub"
656656
external const_nsw_sub : llvalue -> llvalue -> llvalue = "llvm_const_nsw_sub"
657657
external const_nuw_sub : llvalue -> llvalue -> llvalue = "llvm_const_nuw_sub"
658-
external const_mul : llvalue -> llvalue -> llvalue = "llvm_const_mul"
659-
external const_nsw_mul : llvalue -> llvalue -> llvalue = "llvm_const_nsw_mul"
660-
external const_nuw_mul : llvalue -> llvalue -> llvalue = "llvm_const_nuw_mul"
661658
external const_xor : llvalue -> llvalue -> llvalue = "llvm_const_xor"
662659
external const_gep : lltype -> llvalue -> llvalue array -> llvalue
663660
= "llvm_const_gep"

llvm/bindings/ocaml/llvm/llvm.mli

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,20 +1131,6 @@ val const_nsw_sub : llvalue -> llvalue -> llvalue
11311131
See the method [llvm::ConstantExpr::getNSWSub]. *)
11321132
val const_nuw_sub : llvalue -> llvalue -> llvalue
11331133

1134-
(** [const_mul c1 c2] returns the constant product of two constants.
1135-
See the method [llvm::ConstantExpr::getMul]. *)
1136-
val const_mul : llvalue -> llvalue -> llvalue
1137-
1138-
(** [const_nsw_mul c1 c2] returns the constant product of two constants with
1139-
no signed wrapping. The result is undefined if the sum overflows.
1140-
See the method [llvm::ConstantExpr::getNSWMul]. *)
1141-
val const_nsw_mul : llvalue -> llvalue -> llvalue
1142-
1143-
(** [const_nuw_mul c1 c2] returns the constant product of two constants with
1144-
no unsigned wrapping. The result is undefined if the sum overflows.
1145-
See the method [llvm::ConstantExpr::getNSWMul]. *)
1146-
val const_nuw_mul : llvalue -> llvalue -> llvalue
1147-
11481134
(** [const_xor c1 c2] returns the constant bitwise [XOR] of two integer
11491135
constants.
11501136
See the method [llvm::ConstantExpr::getXor]. *)

llvm/bindings/ocaml/llvm/llvm_ocaml.c

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,24 +1210,6 @@ value llvm_const_nuw_sub(value LHS, value RHS) {
12101210
return to_val(Value);
12111211
}
12121212

1213-
/* llvalue -> llvalue -> llvalue */
1214-
value llvm_const_mul(value LHS, value RHS) {
1215-
LLVMValueRef Value = LLVMConstMul(Value_val(LHS), Value_val(RHS));
1216-
return to_val(Value);
1217-
}
1218-
1219-
/* llvalue -> llvalue -> llvalue */
1220-
value llvm_const_nsw_mul(value LHS, value RHS) {
1221-
LLVMValueRef Value = LLVMConstNSWMul(Value_val(LHS), Value_val(RHS));
1222-
return to_val(Value);
1223-
}
1224-
1225-
/* llvalue -> llvalue -> llvalue */
1226-
value llvm_const_nuw_mul(value LHS, value RHS) {
1227-
LLVMValueRef Value = LLVMConstNUWMul(Value_val(LHS), Value_val(RHS));
1228-
return to_val(Value);
1229-
}
1230-
12311213
/* llvalue -> llvalue -> llvalue */
12321214
value llvm_const_xor(value LHS, value RHS) {
12331215
LLVMValueRef Value = LLVMConstXor(Value_val(LHS), Value_val(RHS));

llvm/docs/LangRef.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5113,10 +5113,6 @@ The following is the syntax for constant expressions:
51135113
Perform an addition on constants.
51145114
``sub (LHS, RHS)``
51155115
Perform a subtraction on constants.
5116-
``mul (LHS, RHS)``
5117-
Perform a multiplication on constants.
5118-
``shl (LHS, RHS)``
5119-
Perform a left shift on constants.
51205116
``xor (LHS, RHS)``
51215117
Perform a bitwise xor on constants.
51225118

llvm/docs/ReleaseNotes.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ Changes to the LLVM IR
5757
----------------------
5858

5959
* The `nocapture` attribute has been replaced by `captures(none)`.
60+
* The constant expression variants of the following instructions have been
61+
removed:
62+
63+
* `mul`
6064

6165
Changes to LLVM infrastructure
6266
------------------------------
@@ -121,6 +125,15 @@ Changes to the Python bindings
121125
Changes to the C API
122126
--------------------
123127

128+
* The following functions for creating constant expressions have been removed,
129+
because the underlying constant expressions are no longer supported. Instead,
130+
an instruction should be created using the `LLVMBuildXYZ` APIs, which will
131+
constant fold the operands if possible and create an instruction otherwise:
132+
133+
* `LLVMConstMul`
134+
* `LLVMConstNUWMul`
135+
* `LLVMConstNSWMul`
136+
124137
Changes to the CodeGen infrastructure
125138
-------------------------------------
126139

llvm/include/llvm-c/Core.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2459,9 +2459,6 @@ LLVMValueRef LLVMConstNUWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
24592459
LLVMValueRef LLVMConstSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
24602460
LLVMValueRef LLVMConstNSWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
24612461
LLVMValueRef LLVMConstNUWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
2462-
LLVMValueRef LLVMConstMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
2463-
LLVMValueRef LLVMConstNSWMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
2464-
LLVMValueRef LLVMConstNUWMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
24652462
LLVMValueRef LLVMConstXor(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
24662463
LLVMValueRef LLVMConstGEP2(LLVMTypeRef Ty, LLVMValueRef ConstantVal,
24672464
LLVMValueRef *ConstantIndices, unsigned NumIndices);

llvm/include/llvm/IR/Constants.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,8 +1143,6 @@ class ConstantExpr : public Constant {
11431143
bool HasNSW = false);
11441144
static Constant *getSub(Constant *C1, Constant *C2, bool HasNUW = false,
11451145
bool HasNSW = false);
1146-
static Constant *getMul(Constant *C1, Constant *C2, bool HasNUW = false,
1147-
bool HasNSW = false);
11481146
static Constant *getXor(Constant *C1, Constant *C2);
11491147
static Constant *getTrunc(Constant *C, Type *Ty, bool OnlyIfReduced = false);
11501148
static Constant *getPtrToInt(Constant *C, Type *Ty,
@@ -1174,14 +1172,6 @@ class ConstantExpr : public Constant {
11741172
return getSub(C1, C2, true, false);
11751173
}
11761174

1177-
static Constant *getNSWMul(Constant *C1, Constant *C2) {
1178-
return getMul(C1, C2, false, true);
1179-
}
1180-
1181-
static Constant *getNUWMul(Constant *C1, Constant *C2) {
1182-
return getMul(C1, C2, true, false);
1183-
}
1184-
11851175
/// If C is a scalar/fixed width vector of known powers of 2, then this
11861176
/// function returns a new scalar/fixed width vector obtained from logBase2
11871177
/// of C. Undef vector elements are set to zero.

llvm/lib/AsmParser/LLParser.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4301,6 +4301,8 @@ bool LLParser::parseValID(ValID &ID, PerFunctionState *PFS, Type *ExpectedTy) {
43014301
return error(ID.Loc, "ashr constexprs are no longer supported");
43024302
case lltok::kw_shl:
43034303
return error(ID.Loc, "shl constexprs are no longer supported");
4304+
case lltok::kw_mul:
4305+
return error(ID.Loc, "mul constexprs are no longer supported");
43044306
case lltok::kw_fneg:
43054307
return error(ID.Loc, "fneg constexprs are no longer supported");
43064308
case lltok::kw_select:
@@ -4329,7 +4331,6 @@ bool LLParser::parseValID(ValID &ID, PerFunctionState *PFS, Type *ExpectedTy) {
43294331
// Binary Operators.
43304332
case lltok::kw_add:
43314333
case lltok::kw_sub:
4332-
case lltok::kw_mul:
43334334
case lltok::kw_xor: {
43344335
bool NUW = false;
43354336
bool NSW = false;

llvm/lib/IR/Constants.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2422,10 +2422,10 @@ bool ConstantExpr::isSupportedBinOp(unsigned Opcode) {
24222422
case Instruction::LShr:
24232423
case Instruction::AShr:
24242424
case Instruction::Shl:
2425+
case Instruction::Mul:
24252426
return false;
24262427
case Instruction::Add:
24272428
case Instruction::Sub:
2428-
case Instruction::Mul:
24292429
case Instruction::Xor:
24302430
return true;
24312431
default:
@@ -2649,13 +2649,6 @@ Constant *ConstantExpr::getSub(Constant *C1, Constant *C2,
26492649
return get(Instruction::Sub, C1, C2, Flags);
26502650
}
26512651

2652-
Constant *ConstantExpr::getMul(Constant *C1, Constant *C2,
2653-
bool HasNUW, bool HasNSW) {
2654-
unsigned Flags = (HasNUW ? OverflowingBinaryOperator::NoUnsignedWrap : 0) |
2655-
(HasNSW ? OverflowingBinaryOperator::NoSignedWrap : 0);
2656-
return get(Instruction::Mul, C1, C2, Flags);
2657-
}
2658-
26592652
Constant *ConstantExpr::getXor(Constant *C1, Constant *C2) {
26602653
return get(Instruction::Xor, C1, C2);
26612654
}

llvm/lib/IR/Core.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1803,23 +1803,6 @@ LLVMValueRef LLVMConstNUWSub(LLVMValueRef LHSConstant,
18031803
unwrap<Constant>(RHSConstant)));
18041804
}
18051805

1806-
LLVMValueRef LLVMConstMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
1807-
return wrap(ConstantExpr::getMul(unwrap<Constant>(LHSConstant),
1808-
unwrap<Constant>(RHSConstant)));
1809-
}
1810-
1811-
LLVMValueRef LLVMConstNSWMul(LLVMValueRef LHSConstant,
1812-
LLVMValueRef RHSConstant) {
1813-
return wrap(ConstantExpr::getNSWMul(unwrap<Constant>(LHSConstant),
1814-
unwrap<Constant>(RHSConstant)));
1815-
}
1816-
1817-
LLVMValueRef LLVMConstNUWMul(LLVMValueRef LHSConstant,
1818-
LLVMValueRef RHSConstant) {
1819-
return wrap(ConstantExpr::getNUWMul(unwrap<Constant>(LHSConstant),
1820-
unwrap<Constant>(RHSConstant)));
1821-
}
1822-
18231806
LLVMValueRef LLVMConstXor(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
18241807
return wrap(ConstantExpr::getXor(unwrap<Constant>(LHSConstant),
18251808
unwrap<Constant>(RHSConstant)));

llvm/test/Analysis/ValueTracking/known-non-equal.ll

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,13 @@ define i1 @mul5(i8 %B, i8 %C) {
206206
define i1 @mul_constantexpr(i16 %a) {
207207
; CHECK-LABEL: @mul_constantexpr(
208208
; CHECK-NEXT: [[MUL:%.*]] = mul nsw i16 [[A:%.*]], 3
209-
; CHECK-NEXT: [[CMP:%.*]] = icmp eq i16 mul nsw (i16 ptrtoint (ptr @g to i16), i16 -1), [[MUL]]
209+
; CHECK-NEXT: [[MUL2:%.*]] = mul nsw i16 ptrtoint (ptr @g to i16), -1
210+
; CHECK-NEXT: [[CMP:%.*]] = icmp eq i16 [[MUL2]], [[MUL]]
210211
; CHECK-NEXT: ret i1 [[CMP]]
211212
;
212213
%mul = mul nsw i16 %a, 3
213-
%cmp = icmp eq i16 mul nsw (i16 ptrtoint (ptr @g to i16), i16 -1), %mul
214+
%mul2 = mul nsw i16 ptrtoint (ptr @g to i16), -1
215+
%cmp = icmp eq i16 %mul2, %mul
214216
ret i1 %cmp
215217
}
216218

llvm/test/Assembler/ConstantExprFold.ll

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
@add = global ptr inttoptr (i64 add (i64 ptrtoint (ptr @A to i64), i64 0) to ptr) ; X + 0 == X
1212
@sub = global ptr inttoptr (i64 sub (i64 ptrtoint (ptr @A to i64), i64 0) to ptr) ; X - 0 == X
13-
@mul = global ptr inttoptr (i64 mul (i64 ptrtoint (ptr @A to i64), i64 0) to ptr) ; X * 0 == 0
1413
@xor = global ptr inttoptr (i64 xor (i64 ptrtoint (ptr @A to i64), i64 0) to ptr) ; X ^ 0 == X
1514

1615
%Ty = type { i32, i32 }
@@ -33,7 +32,6 @@
3332
; CHECK: @A = global i64 0
3433
; CHECK: @add = global ptr @A
3534
; CHECK: @sub = global ptr @A
36-
; CHECK: @mul = global ptr null
3735
; CHECK: @xor = global ptr @A
3836
; CHECK: @B = external global %Ty
3937
; CHECK: @cons = weak global i32 0, align 8

llvm/test/Assembler/flags.ll

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,6 @@ define i64 @sub_both_ce() {
170170
ret i64 sub nsw nuw (i64 ptrtoint (ptr @addr to i64), i64 91)
171171
}
172172

173-
define i64 @mul_both_ce() {
174-
; CHECK: ret i64 mul nuw nsw (i64 ptrtoint (ptr @addr to i64), i64 91)
175-
ret i64 mul nuw nsw (i64 ptrtoint (ptr @addr to i64), i64 91)
176-
}
177-
178173
define ptr @gep_nw_ce() {
179174
; CHECK: ret ptr getelementptr inbounds (i64, ptr @addr, i64 171)
180175
ret ptr getelementptr inbounds (i64, ptr @addr, i64 171)
@@ -190,11 +185,6 @@ define i64 @sub_plain_ce() {
190185
ret i64 sub (i64 ptrtoint (ptr @addr to i64), i64 91)
191186
}
192187

193-
define i64 @mul_plain_ce() {
194-
; CHECK: ret i64 mul (i64 ptrtoint (ptr @addr to i64), i64 91)
195-
ret i64 mul (i64 ptrtoint (ptr @addr to i64), i64 91)
196-
}
197-
198188
define ptr @gep_plain_ce() {
199189
; CHECK: ret ptr getelementptr (i64, ptr @addr, i64 171)
200190
ret ptr getelementptr (i64, ptr @addr, i64 171)
@@ -210,11 +200,6 @@ define i64 @sub_both_reversed_ce() {
210200
ret i64 sub nsw nuw (i64 ptrtoint (ptr @addr to i64), i64 91)
211201
}
212202

213-
define i64 @mul_both_reversed_ce() {
214-
; CHECK: ret i64 mul nuw nsw (i64 ptrtoint (ptr @addr to i64), i64 91)
215-
ret i64 mul nsw nuw (i64 ptrtoint (ptr @addr to i64), i64 91)
216-
}
217-
218203
define i64 @add_signed_ce() {
219204
; CHECK: ret i64 add nsw (i64 ptrtoint (ptr @addr to i64), i64 91)
220205
ret i64 add nsw (i64 ptrtoint (ptr @addr to i64), i64 91)
@@ -225,11 +210,6 @@ define i64 @sub_signed_ce() {
225210
ret i64 sub nsw (i64 ptrtoint (ptr @addr to i64), i64 91)
226211
}
227212

228-
define i64 @mul_signed_ce() {
229-
; CHECK: ret i64 mul nsw (i64 ptrtoint (ptr @addr to i64), i64 91)
230-
ret i64 mul nsw (i64 ptrtoint (ptr @addr to i64), i64 91)
231-
}
232-
233213
define i64 @add_unsigned_ce() {
234214
; CHECK: ret i64 add nuw (i64 ptrtoint (ptr @addr to i64), i64 91)
235215
ret i64 add nuw (i64 ptrtoint (ptr @addr to i64), i64 91)
@@ -240,11 +220,6 @@ define i64 @sub_unsigned_ce() {
240220
ret i64 sub nuw (i64 ptrtoint (ptr @addr to i64), i64 91)
241221
}
242222

243-
define i64 @mul_unsigned_ce() {
244-
; CHECK: ret i64 mul nuw (i64 ptrtoint (ptr @addr to i64), i64 91)
245-
ret i64 mul nuw (i64 ptrtoint (ptr @addr to i64), i64 91)
246-
}
247-
248223
define i64 @test_zext(i32 %a) {
249224
; CHECK: %res = zext nneg i32 %a to i64
250225
%res = zext nneg i32 %a to i64

llvm/test/Bindings/OCaml/core.ml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,6 @@ let test_constants () =
271271
* CHECK: @const_sub = global i64 sub
272272
* CHECK: @const_nsw_sub = global i64 sub nsw
273273
* CHECK: @const_nuw_sub = global i64 sub nuw
274-
* CHECK: @const_mul = global i64 mul
275-
* CHECK: @const_nsw_mul = global i64 mul nsw
276-
* CHECK: @const_nuw_mul = global i64 mul nuw
277274
* CHECK: @const_xor = global i64 xor
278275
*)
279276
let void_ptr = pointer_type context in
@@ -290,9 +287,6 @@ let test_constants () =
290287
ignore (define_global "const_sub" (const_sub foldbomb five) m);
291288
ignore (define_global "const_nsw_sub" (const_nsw_sub foldbomb five) m);
292289
ignore (define_global "const_nuw_sub" (const_nuw_sub foldbomb five) m);
293-
ignore (define_global "const_mul" (const_mul foldbomb five) m);
294-
ignore (define_global "const_nsw_mul" (const_nsw_mul foldbomb five) m);
295-
ignore (define_global "const_nuw_mul" (const_nuw_mul foldbomb five) m);
296290
ignore (define_global "const_xor" (const_xor foldbomb five) m);
297291

298292
group "constant casts";

llvm/test/CodeGen/ARM/2008-04-04-ScavengerAssert.ll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ bb17.i: ; preds = %cond_next119.i
4646
cond_true53.i: ; preds = %bb17.i
4747
ret ptr null
4848
cond_false99.i: ; preds = %bb17.i
49-
%malloccall = tail call ptr @malloc(i32 trunc (i64 mul nuw (i64 ptrtoint (ptr getelementptr (ptr, ptr null, i32 1) to i64), i64 2) to i32))
49+
%mul = mul nuw i64 ptrtoint (ptr getelementptr (ptr, ptr null, i32 1) to i64), 2
50+
%trunc = trunc i64 %mul to i32
51+
%malloccall = tail call ptr @malloc(i32 %trunc)
5052
br i1 false, label %bb126.i, label %cond_next119.i
5153
cond_next119.i: ; preds = %cond_false99.i, %bb42
5254
%curr_ptr.0.reg2mem.0.i = phi ptr [ %malloccall, %cond_false99.i ], [ null, %bb42 ] ; <ptr> [#uses=2]

llvm/test/CodeGen/X86/ptrtoint-constexpr.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99

1010
; CHECK: .globl x
1111
; CHECK: x:
12-
; CHECK: .quad 3
12+
; CHECK: .quad 1+3
1313

14-
@x = global i64 mul (i64 3, i64 ptrtoint (ptr getelementptr (i2, ptr null, i64 1) to i64))
14+
@x = global i64 add (i64 3, i64 ptrtoint (ptr getelementptr (i2, ptr null, i64 1) to i64))

llvm/test/Other/constant-fold-gep-address-spaces.ll

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,10 @@ target datalayout = "e-p:128:128:128-p1:32:32:32-p2:8:8:8-p3:16:16:16-p4:64:64:6
2424
; The target-independent folder should be able to do some clever
2525
; simplifications on sizeof, alignof, and offsetof expressions. The
2626
; target-dependent folder should fold these down to constants.
27-
; PLAIN-X: @a = constant i64 mul (i64 ptrtoint (ptr addrspace(4) getelementptr (double, ptr addrspace(4) null, i32 1) to i64), i64 2310)
28-
@a = constant i64 mul (i64 3, i64 mul (i64 ptrtoint (ptr addrspace(4) getelementptr ({[7 x double], [7 x double]}, ptr addrspace(4) null, i64 11) to i64), i64 5))
2927

3028
; PLAIN-X: @b = constant i64 ptrtoint (ptr addrspace(4) getelementptr ({ i1, double }, ptr null, i64 0, i32 1) to i64)
3129
@b = constant i64 ptrtoint (ptr addrspace(4) getelementptr ({i1, [13 x double]}, ptr addrspace(4) null, i64 0, i32 1) to i64)
3230

33-
; PLAIN-X: @c = constant i64 mul nuw (i64 ptrtoint (ptr addrspace(4) getelementptr (double, ptr addrspace(4) null, i32 1) to i64), i64 2)
34-
@c = constant i64 ptrtoint (ptr addrspace(4) getelementptr ({double, double, double, double}, ptr addrspace(4) null, i64 0, i32 2) to i64)
35-
36-
; PLAIN-X: @d = constant i64 mul nuw (i64 ptrtoint (ptr addrspace(4) getelementptr (double, ptr addrspace(4) null, i32 1) to i64), i64 11)
37-
@d = constant i64 ptrtoint (ptr addrspace(4) getelementptr ([13 x double], ptr addrspace(4) null, i64 0, i32 11) to i64)
38-
3931
; PLAIN-X: @e = constant i64 ptrtoint (ptr addrspace(4) getelementptr ({ double, float, double, double }, ptr null, i64 0, i32 2) to i64)
4032
@e = constant i64 ptrtoint (ptr addrspace(4) getelementptr ({double, float, double, double}, ptr addrspace(4) null, i64 0, i32 2) to i64)
4133

@@ -123,10 +115,6 @@ define ptr addrspace(2) @hoo1() #0 {
123115
ret ptr addrspace(2) %t
124116
}
125117

126-
; PLAIN-X: define i64 @fa() #0 {
127-
; PLAIN-X: %t = bitcast i64 mul (i64 ptrtoint (ptr addrspace(4) getelementptr (double, ptr addrspace(4) null, i32 1) to i64), i64 2310) to i64
128-
; PLAIN-X: ret i64 %t
129-
; PLAIN-X: }
130118
; PLAIN-X: define i64 @fb() #0 {
131119
; PLAIN-X: %t = bitcast i64 ptrtoint (ptr addrspace(4) getelementptr ({ i1, double }, ptr null, i64 0, i32 1) to i64) to i64
132120
; PLAIN-X: ret i64 %t
@@ -159,10 +147,6 @@ define ptr addrspace(2) @hoo1() #0 {
159147
; PLAIN-X: %t = bitcast i64 ptrtoint (ptr addrspace(2) getelementptr ({ i1, ptr addrspace(2) }, ptr null, i64 0, i32 1) to i64) to i64
160148
; PLAIN-X: ret i64 %t
161149
; PLAIN-X: }
162-
define i64 @fa() #0 {
163-
%t = bitcast i64 mul (i64 3, i64 mul (i64 ptrtoint (ptr getelementptr ({[7 x double], [7 x double]}, ptr null, i64 11) to i64), i64 5)) to i64
164-
ret i64 %t
165-
}
166150
define i64 @fb() #0 {
167151
%t = bitcast i64 ptrtoint (ptr addrspace(4) getelementptr ({i1, [13 x double]}, ptr addrspace(4) null, i64 0, i32 1) to i64) to i64
168152
ret i64 %t

0 commit comments

Comments
 (0)