Skip to content

Commit

Permalink
Merged master:67087a7b765 into amd-gfx:420522c57c1
Browse files Browse the repository at this point in the history
Local branch amd-gfx 420522c Merged master:96282b1a0c4 into amd-gfx:c8c3ec5d216
Remote branch master 67087a7 [LLDB] Fix typo in xfail decorator assert.test
  • Loading branch information
Sw authored and Sw committed May 13, 2020
2 parents 420522c + 67087a7 commit 120607d
Show file tree
Hide file tree
Showing 13 changed files with 238 additions and 22 deletions.
2 changes: 1 addition & 1 deletion libcxx/include/functional
Original file line number Diff line number Diff line change
Expand Up @@ -2387,7 +2387,7 @@ public:
function& operator=(const function&);
function& operator=(function&&) _NOEXCEPT;
function& operator=(nullptr_t) _NOEXCEPT;
template<class _Fp, class = _EnableIfCallable<_Fp>>
template<class _Fp, class = _EnableIfCallable<typename decay<_Fp>::type>>
function& operator=(_Fp&&);

~function();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,26 @@ int main(int, char**)
static_assert(!std::is_assignable<Fn&, RValueCallable&>::value, "");
static_assert(!std::is_assignable<Fn&, RValueCallable>::value, "");
}
{
using Fn = std::function<void(int, int, int)>;
static_assert(std::is_assignable<Fn&, Fn&&>::value, "");
}
{
using F1 = std::function<void(int, int)>;
using F2 = std::function<void(int, int, int)>;
static_assert(!std::is_assignable<F1&, F2&&>::value, "");
}
{
using F1 = std::function<int(int, int)>;
using F2 = std::function<A (int, int)>;
static_assert(!std::is_assignable<F1&, F2&&>::value, "");
static_assert(!std::is_assignable<F2&, F1&&>::value, "");
}
{
using F1 = std::function<void(int, int)>;
using F2 = std::function<void(int, int)&&>;
static_assert(!std::is_assignable<F1&, F2&&>::value, "");
}
#endif

return 0;
Expand Down
2 changes: 1 addition & 1 deletion libcxx/www/cxx1z_status.html
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ <h3>Library Working group Issues Status</h3>
<tr><td><a href="https://wg21.link/LWG2566">2566</a></td><td>Requirements on the first template parameter of container adaptors</td><td>Jacksonville</td><td>Complete</td></tr>
<tr><td><a href="https://wg21.link/LWG2571">2571</a></td><td>&sect;[map.modifiers]/2 imposes nonsensical requirement on <tt>insert(InputIterator, InputIterator)</tt></td><td>Jacksonville</td><td>Complete</td></tr>
<tr><td><a href="https://wg21.link/LWG2572">2572</a></td><td>The remarks for <tt>shared_ptr::operator*</tt> should apply to <i>cv</i>-qualified <tt>void</tt> as well</td><td>Jacksonville</td><td>Complete</td></tr>
<tr><td><a href="https://wg21.link/LWG2574">2574</a></td><td>[fund.ts.v2] <tt>std::experimental::function::operator=(F&amp;&amp;)</tt> should be constrained</td><td>Jacksonville</td><td></td></tr>
<tr><td><a href="https://wg21.link/LWG2574">2574</a></td><td>[fund.ts.v2] <tt>std::experimental::function::operator=(F&amp;&amp;)</tt> should be constrained</td><td>Jacksonville</td><td>Complete</td></tr>
<tr><td><a href="https://wg21.link/LWG2575">2575</a></td><td>[fund.ts.v2] <tt>experimental::function::assign</tt> should be removed</td><td>Jacksonville</td><td></td></tr>
<tr><td><a href="https://wg21.link/LWG2576">2576</a></td><td><tt>istream_iterator</tt> and <tt>ostream_iterator</tt> should use <tt>std::addressof</tt></td><td>Jacksonville</td><td>Complete</td></tr>
<tr><td><a href="https://wg21.link/LWG2577">2577</a></td><td><tt>{shared,unique}_lock</tt> should use <tt>std::addressof</tt></td><td>Jacksonville</td><td>Complete</td></tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def setUp(self):
@not_remote_testsuite_ready
@skipIfWindows # Windows doesn't have dlopen and friends, dynamic libraries work differently
@expectedFlakeyNetBSD
@expectedFailureAll(oslist=["linux"], archs=['arm'], bugnumber="llvm.org/pr45894")
def test_load_using_paths(self):
"""Test that we can load a module by providing a set of search paths."""
if self.platformIsDarwin():
Expand Down
1 change: 1 addition & 0 deletions lldb/test/API/python_api/thread/TestThreadAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def test_run_to_address(self):
self.run_to_address(self.exe_name)

@add_test_categories(['pyapi'])
@expectedFailureAll(oslist=["linux"], archs=['arm'], bugnumber="llvm.org/pr45892")
@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr20476')
@expectedFailureAll(oslist=["windows"])
@expectedFailureNetBSD
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
# in the .dynsym section of the main binary. The bits removing .rela.plt,
# .rela.dyn and .dynsym sections can be removed once llvm-objcopy
# --only-keep-debug starts to work.
# RUN: llvm-objcopy --remove-section=.rela.plt --remove-section=.rela.dyn \
# RUN: llvm-objcopy --remove-section=.rela.plt --remove-section=.rela.dyn --remove-section=.rel.plt --remove-section=.rel.dyn \
# RUN: --remove-section=.gnu.version --remove-section=.gnu.hash --remove-section=.hash --remove-section=.dynsym %t.mini_debuginfo

# Drop the full debug info from the original binary.
Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/Recognizer/assert.test
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# XFAIL: target-arm && linux-gnu
# UNSUPPORTED: system-windows
# RUN: %clang_host -g -O0 %S/Inputs/assert.c -o %t.out
# RUN: %lldb -b -s %s %t.out | FileCheck %s
Expand Down
46 changes: 30 additions & 16 deletions llvm/lib/Transforms/IPO/AttributorAttributes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1009,20 +1009,23 @@ ChangeStatus AAReturnedValuesImpl::updateImpl(Attributor &A) {
return indicatePessimisticFixpoint();

// Once returned values "directly" present in the code are handled we try to
// resolve returned calls.
// resolve returned calls. To avoid modifications to the ReturnedValues map
// while we iterate over it we kept record of potential new entries in a copy
// map, NewRVsMap.
decltype(ReturnedValues) NewRVsMap;
for (auto &It : ReturnedValues) {
LLVM_DEBUG(dbgs() << "[AAReturnedValues] Returned value: " << *It.first
<< " by #" << It.second.size() << " RIs\n");
CallBase *CB = dyn_cast<CallBase>(It.first);

auto HandleReturnValue = [&](Value *RV, SmallSetVector<ReturnInst *, 4> &RIs) {
LLVM_DEBUG(dbgs() << "[AAReturnedValues] Returned value: " << *RV
<< " by #" << RIs.size() << " RIs\n");
CallBase *CB = dyn_cast<CallBase>(RV);
if (!CB || UnresolvedCalls.count(CB))
continue;
return;

if (!CB->getCalledFunction()) {
LLVM_DEBUG(dbgs() << "[AAReturnedValues] Unresolved call: " << *CB
<< "\n");
UnresolvedCalls.insert(CB);
continue;
return;
}

// TODO: use the function scope once we have call site AAReturnedValues.
Expand All @@ -1037,15 +1040,15 @@ ChangeStatus AAReturnedValuesImpl::updateImpl(Attributor &A) {
LLVM_DEBUG(dbgs() << "[AAReturnedValues] Unresolved call: " << *CB
<< "\n");
UnresolvedCalls.insert(CB);
continue;
return;
}

// Do not try to learn partial information. If the callee has unresolved
// return values we will treat the call as unresolved/opaque.
auto &RetValAAUnresolvedCalls = RetValAA.getUnresolvedCalls();
if (!RetValAAUnresolvedCalls.empty()) {
UnresolvedCalls.insert(CB);
continue;
return;
}

// Now check if we can track transitively returned values. If possible, thus
Expand All @@ -1067,14 +1070,14 @@ ChangeStatus AAReturnedValuesImpl::updateImpl(Attributor &A) {
}

if (Unresolved)
continue;
return;

// Now track transitively returned values.
unsigned &NumRetAA = NumReturnedValuesPerKnownAA[CB];
if (NumRetAA == RetValAA.getNumReturnValues()) {
LLVM_DEBUG(dbgs() << "[AAReturnedValues] Skip call as it has not "
"changed since it was seen last\n");
continue;
return;
}
NumRetAA = RetValAA.getNumReturnValues();

Expand All @@ -1093,21 +1096,32 @@ ChangeStatus AAReturnedValuesImpl::updateImpl(Attributor &A) {
continue;
} else if (isa<Constant>(RetVal)) {
// Constants are valid everywhere, we can simply take them.
NewRVsMap[RetVal].insert(It.second.begin(), It.second.end());
NewRVsMap[RetVal].insert(RIs.begin(), RIs.end());
continue;
}
}
}
};

for (auto &It : ReturnedValues)
HandleReturnValue(It.first, It.second);

// Because processing the new information can again lead to new return values
// we have to be careful and iterate until this iteration is complete. The
// idea is that we are in a stable state at the end of an update. All return
// values have been handled and properly categorized. We might not update
// again if we have not requested a non-fix attribute so we cannot "wait" for
// the next update to analyze a new return value.
while (!NewRVsMap.empty()) {
auto It = std::move(NewRVsMap.back());
NewRVsMap.pop_back();

// To avoid modifications to the ReturnedValues map while we iterate over it
// we kept record of potential new entries in a copy map, NewRVsMap.
for (auto &It : NewRVsMap) {
assert(!It.second.empty() && "Entry does not add anything.");
auto &ReturnInsts = ReturnedValues[It.first];
for (ReturnInst *RI : It.second)
if (ReturnInsts.insert(RI)) {
LLVM_DEBUG(dbgs() << "[AAReturnedValues] Add new returned value "
<< *It.first << " => " << *RI << "\n");
HandleReturnValue(It.first, ReturnInsts);
Changed = true;
}
}
Expand Down
47 changes: 45 additions & 2 deletions llvm/test/Transforms/Attributor/returned.ll
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --scrub-attributes
; RUN: opt -attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=15 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM
; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=15 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM
; RUN: opt -attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=14 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM
; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=14 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM
; RUN: opt -attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM
; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM
;
Expand Down Expand Up @@ -1234,4 +1234,47 @@ define i32* @dont_use_const() #0 {
ret i32* %c
}

; UTC_ARGS: --disable
;
; Verify we do not derive constraints for @_Z3fooP1X as if it was returning `null`.
;
; CHEKC-NOT: noalias
; CHECK-NOT: align 536870912

%struct.Y = type { %struct.X }
%struct.X = type { i32 (...)** }

@_ZTI1X = external dso_local constant { i8*, i8* }, align 8
@_ZTI1Y = external dso_local constant { i8*, i8*, i8* }, align 8

define internal i8* @_ZN1Y3barEv(%struct.Y* %this) align 2 {
entry:
%0 = bitcast %struct.Y* %this to i8*
ret i8* %0
}

define dso_local i8* @_Z3fooP1X(%struct.X* %x) {
entry:
%0 = icmp eq %struct.X* %x, null
br i1 %0, label %dynamic_cast.null, label %dynamic_cast.notnull

dynamic_cast.notnull: ; preds = %entry
%1 = bitcast %struct.X* %x to i8*
%2 = call i8* @__dynamic_cast(i8* %1, i8* bitcast ({ i8*, i8* }* @_ZTI1X to i8*), i8* bitcast ({ i8*, i8*, i8* }* @_ZTI1Y to i8*), i64 0) #2
%3 = bitcast i8* %2 to %struct.Y*
br label %dynamic_cast.end

dynamic_cast.null: ; preds = %entry
br label %dynamic_cast.end

dynamic_cast.end: ; preds = %dynamic_cast.null, %dynamic_cast.notnull
%QQ5 = phi %struct.Y* [ %3, %dynamic_cast.notnull ], [ null, %dynamic_cast.null ]
%call = call i8* @_ZN1Y3barEv(%struct.Y* %QQ5)
ret i8* %call
}

declare dso_local i8* @__dynamic_cast(i8*, i8*, i8*, i64)

; UTC_ARGS: --enable

attributes #0 = { noinline nounwind uwtable }
52 changes: 51 additions & 1 deletion mlir/lib/Dialect/Vector/VectorTransforms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1187,6 +1187,55 @@ class OuterProductOpLowering : public OpRewritePattern<vector::OuterProductOp> {
}
};

/// Progressive lowering of ConstantMaskOp.
/// One:
/// %x = vector.constant_mask_op [a,b]
/// is replaced by:
/// %z = zero-result
/// %l = vector.constant_mask_op [b]
/// %4 = vector.insert %l, %z[0]
/// ..
/// %x = vector.insert %l, %..[a-1]
/// which will be folded at LLVM IR level.
class ConstantMaskOpLowering : public OpRewritePattern<vector::ConstantMaskOp> {
public:
using OpRewritePattern<vector::ConstantMaskOp>::OpRewritePattern;

LogicalResult matchAndRewrite(vector::ConstantMaskOp op,
PatternRewriter &rewriter) const override {
auto loc = op.getLoc();
auto dstType = op.getResult().getType().cast<VectorType>();
auto eltType = dstType.getElementType();
auto dimSizes = op.mask_dim_sizes();
int64_t rank = dimSizes.size();
int64_t trueDim = dimSizes[0].cast<IntegerAttr>().getInt();

Value trueVal;
if (rank == 1) {
trueVal = rewriter.create<ConstantOp>(
loc, eltType, rewriter.getIntegerAttr(eltType, 1));
} else {
VectorType lowType =
VectorType::get(dstType.getShape().drop_front(), eltType);
SmallVector<int64_t, 4> newDimSizes;
for (int64_t r = 1; r < rank; r++)
newDimSizes.push_back(dimSizes[r].cast<IntegerAttr>().getInt());
trueVal = rewriter.create<vector::ConstantMaskOp>(
loc, lowType, rewriter.getI64ArrayAttr(newDimSizes));
}

Value result = rewriter.create<ConstantOp>(loc, dstType,
rewriter.getZeroAttr(dstType));
for (int64_t d = 0; d < trueDim; d++) {
auto pos = rewriter.getI64ArrayAttr(d);
result =
rewriter.create<vector::InsertOp>(loc, dstType, trueVal, result, pos);
}
rewriter.replaceOp(op, result);
return success();
}
};

/// Progressive lowering of ContractionOp.
/// One:
/// %x = vector.contract with at least one free/batch dimension
Expand Down Expand Up @@ -1609,6 +1658,7 @@ void mlir::vector::populateVectorContractLoweringPatterns(
VectorTransformsOptions parameters) {
patterns.insert<ShapeCastOp2DDownCastRewritePattern,
ShapeCastOp2DUpCastRewritePattern, BroadcastOpLowering,
TransposeOpLowering, OuterProductOpLowering>(context);
TransposeOpLowering, OuterProductOpLowering,
ConstantMaskOpLowering>(context);
patterns.insert<ContractionOpLowering>(parameters, context);
}
17 changes: 17 additions & 0 deletions mlir/test/Conversion/VectorToLLVM/vector-to-llvm.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -917,3 +917,20 @@ func @transfer_read_1d_non_zero_addrspace(%A : memref<?xf32, 3>, %base: index) -
// CHECK-SAME: (!llvm<"float addrspace(3)*">, !llvm.i64) -> !llvm<"float addrspace(3)*">
// CHECK: %[[vecPtr_b:.*]] = llvm.addrspacecast %[[gep_b]] :
// CHECK-SAME: !llvm<"float addrspace(3)*"> to !llvm<"<17 x float>*">

func @genbool_1d() -> vector<8xi1> {
%0 = vector.constant_mask [4] : vector<8xi1>
return %0 : vector<8xi1>
}
// CHECK-LABEL: func @genbool_1d
// CHECK: %[[T0:.*]] = llvm.mlir.constant(1 : i1) : !llvm.i1
// CHECK: %[[T1:.*]] = llvm.mlir.constant(dense<false> : vector<8xi1>) : !llvm<"<8 x i1>">
// CHECK: %[[T2:.*]] = llvm.mlir.constant(0 : i64) : !llvm.i64
// CHECK: %[[T3:.*]] = llvm.insertelement %[[T0]], %[[T1]][%[[T2]] : !llvm.i64] : !llvm<"<8 x i1>">
// CHECK: %[[T4:.*]] = llvm.mlir.constant(1 : i64) : !llvm.i64
// CHECK: %[[T5:.*]] = llvm.insertelement %[[T0]], %[[T3]][%[[T4]] : !llvm.i64] : !llvm<"<8 x i1>">
// CHECK: %[[T6:.*]] = llvm.mlir.constant(2 : i64) : !llvm.i64
// CHECK: %[[T7:.*]] = llvm.insertelement %[[T0]], %[[T5]][%[[T6]] : !llvm.i64] : !llvm<"<8 x i1>">
// CHECK: %[[T8:.*]] = llvm.mlir.constant(3 : i64) : !llvm.i64
// CHECK: %[[T9:.*]] = llvm.insertelement %[[T0]], %[[T7]][%[[T8]] : !llvm.i64] : !llvm<"<8 x i1>">
// CHECK: llvm.return %9 : !llvm<"<8 x i1>">
46 changes: 46 additions & 0 deletions mlir/test/Dialect/Vector/vector-contract-transforms.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -559,3 +559,49 @@ func @broadcast_stretch_in_middle(%arg0: vector<4x1x2xf32>) -> vector<4x3x2xf32>
%0 = vector.broadcast %arg0 : vector<4x1x2xf32> to vector<4x3x2xf32>
return %0 : vector<4x3x2xf32>
}

// CHECK-LABEL: func @genbool_1d
// CHECK: %[[TT:.*]] = constant 1 : i1
// CHECK: %[[C1:.*]] = constant dense<false> : vector<8xi1>
// CHECK: %[[T0.*]] = vector.insert %[[TT]], %[[C1]] [0] : i1 into vector<8xi1>
// CHECK: %[[T1.*]] = vector.insert %[[TT]], %[[T0]] [1] : i1 into vector<8xi1>
// CHECK: %[[T2.*]] = vector.insert %[[TT]], %[[T1]] [2] : i1 into vector<8xi1>
// CHECK: %[[T3.*]] = vector.insert %[[TT]], %[[T2]] [3] : i1 into vector<8xi1>
// CHECK: return %[[T3]] : vector<8xi1>

func @genbool_1d() -> vector<8xi1> {
%0 = vector.constant_mask [4] : vector<8xi1>
return %0 : vector<8xi1>
}

// CHECK-LABEL: func @genbool_2d
// CHECK: %[[TT:.*]] = constant 1 : i1
// CHECK: %[[C1:.*]] = constant dense<false> : vector<4xi1>
// CHECK: %[[C2:.*]] = constant dense<false> : vector<4x4xi1>
// CHECK: %[[T0:.*]] = vector.insert %[[TT]], %[[C1]] [0] : i1 into vector<4xi1>
// CHECK: %[[T1:.*]] = vector.insert %[[TT]], %[[T0]] [1] : i1 into vector<4xi1>
// CHECK: %[[T2:.*]] = vector.insert %[[T1]], %[[C2]] [0] : vector<4xi1> into vector<4x4xi1>
// CHECK: %[[T3:.*]] = vector.insert %[[T1]], %[[T2]] [1] : vector<4xi1> into vector<4x4xi1>
// CHECK: return %[[T3]] : vector<4x4xi1>

func @genbool_2d() -> vector<4x4xi1> {
%v = vector.constant_mask [2, 2] : vector<4x4xi1>
return %v: vector<4x4xi1>
}

// CHECK-LABEL: func @genbool_3d
// CHECK: %[[Tt:.*]] = constant 1 : i1
// CHECK: %[[C1:.*]] = constant dense<false> : vector<4xi1>
// CHECK: %[[C2:.*]] = constant dense<false> : vector<3x4xi1>
// CHECK: %[[C3:.*]] = constant dense<false> : vector<2x3x4xi1>
// CHECK: %[[T0:.*]] = vector.insert %[[TT]], %[[C1]] [0] : i1 into vector<4xi1>
// CHECK: %[[T1:.*]] = vector.insert %[[TT]], %[[T0]] [1] : i1 into vector<4xi1>
// CHECK: %[[T2:.*]] = vector.insert %[[TT]], %[[T1]] [2] : i1 into vector<4xi1>
// CHECK: %[[T3:.*]] = vector.insert %[[T2]], %[[C2]] [0] : vector<4xi1> into vector<3x4xi1>
// CHECK: %[[T4:.*]] = vector.insert %[[T3]], %[[C3]] [0] : vector<3x4xi1> into vector<2x3x4xi1>
// CHECK: return %[[T4]] : vector<2x3x4xi1>

func @genbool_3d() -> vector<2x3x4xi1> {
%v = vector.constant_mask [1, 1, 3] : vector<2x3x4xi1>
return %v: vector<2x3x4xi1>
}
23 changes: 23 additions & 0 deletions mlir/test/Target/vector-to-llvm-ir.mlir
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// RUN: mlir-opt %s -convert-vector-to-llvm | mlir-translate -mlir-to-llvmir | FileCheck %s

func @genbool_1d() -> vector<8xi1> {
%0 = vector.constant_mask [4] : vector<8xi1>
return %0 : vector<8xi1>
}
// CHECK-LABEL: @genbool_1d()
// CHECK-NEXT: ret <8 x i1> <i1 true, i1 true, i1 true, i1 true, i1 false, i1 false, i1 false, i1 false>

func @genbool_2d() -> vector<4x4xi1> {
%v = vector.constant_mask [2, 2] : vector<4x4xi1>
return %v: vector<4x4xi1>
}
// CHECK-LABEL: @genbool_2d()
// CHECK-NEXT: ret [4 x <4 x i1>] [<4 x i1> <i1 true, i1 true, i1 false, i1 false>, <4 x i1> <i1 true, i1 true, i1 false, i1 false>, <4 x i1> zeroinitializer, <4 x i1> zeroinitializer]

func @genbool_3d() -> vector<2x3x4xi1> {
%v = vector.constant_mask [1, 1, 3] : vector<2x3x4xi1>
return %v: vector<2x3x4xi1>
}
// CHECK-LABEL: @genbool_3d()
// CHECK-NEXT: ret [2 x [3 x <4 x i1>]] {{\[+}}3 x <4 x i1>] [<4 x i1> <i1 true, i1 true, i1 true, i1 false>, <4 x i1> zeroinitializer, <4 x i1> zeroinitializer], [3 x <4 x i1>] zeroinitializer]
// note: awkward syntax to match [[

0 comments on commit 120607d

Please sign in to comment.