Page MenuHomePhabricator
Feed Advanced Search

Today

craig.topper added a comment to D104178: [X86] Add ISD::FREEZE and ISD::AssertAlign to the list of opcodes that don't guarantee upper 32 bits are zero..

LGTM - does this need to be back ported to 12.x?

Sat, Jun 12, 10:00 AM · Restricted Project
craig.topper committed rGc997867dc084: [X86] Add ISD::FREEZE and ISD::AssertAlign to the list of opcodes that don't… (authored by craig.topper).
[X86] Add ISD::FREEZE and ISD::AssertAlign to the list of opcodes that don't…
Sat, Jun 12, 9:57 AM
craig.topper closed D104178: [X86] Add ISD::FREEZE and ISD::AssertAlign to the list of opcodes that don't guarantee upper 32 bits are zero..
Sat, Jun 12, 9:56 AM · Restricted Project

Yesterday

craig.topper requested review of D104178: [X86] Add ISD::FREEZE and ISD::AssertAlign to the list of opcodes that don't guarantee upper 32 bits are zero..
Fri, Jun 11, 11:57 PM · Restricted Project
craig.topper requested review of D104163: [RISCV] Add isel patterns to match vmacc/vmadd/vnmsub/vnmsac from add/sub and mul..
Fri, Jun 11, 5:24 PM · Restricted Project
craig.topper updated the diff for D104069: [RISCV] Teach vsetvli insertion to remember when predecessors have same AVL and SEW/LMUL ratio if their VTYPEs otherwise mismatch..

Fixed typo in comment

Fri, Jun 11, 12:14 PM · Restricted Project
craig.topper accepted D93470: [VP] Binary floating-point intrinsics..

LGTM

Fri, Jun 11, 11:35 AM · Restricted Project, Restricted Project
craig.topper accepted D103480: [NFC][OpaquePtr] Explicitly pass GEP source type in optimizeGatherScatterInst().

LGTM

Fri, Jun 11, 11:33 AM · Restricted Project
craig.topper added inline comments to D103480: [NFC][OpaquePtr] Explicitly pass GEP source type in optimizeGatherScatterInst().
Fri, Jun 11, 11:17 AM · Restricted Project
craig.topper added a comment to D104037: [X86] Check immediate before get it..

I don't what Intel's original failure looked like, but here's a test that should reproduce this with -run-pass=machinelicm https://reviews.llvm.org/P8267 needs more cleanup.

Fri, Jun 11, 10:21 AM · Restricted Project
craig.topper added inline comments to D104107: [NFCI][X86] Drop "atom"/"slm" target tuning "features", derive them from CPU string.
Fri, Jun 11, 9:08 AM · Restricted Project

Thu, Jun 10

craig.topper added a comment to D104037: [X86] Check immediate before get it..

It would be nice to have a test, but this change seems ok.

Thu, Jun 10, 11:10 PM · Restricted Project
craig.topper committed rG081ae5fe1aa3: [RISCV] Remove extra assignment of intrinsic ID in ManualCodegen. NFC (authored by craig.topper).
[RISCV] Remove extra assignment of intrinsic ID in ManualCodegen. NFC
Thu, Jun 10, 8:47 PM
craig.topper committed rG420bd5ee8ec9: [RISCV] Use ComputeNumSignBits/MaskedValueIsZero in RISCVDAGToDAGISel… (authored by craig.topper).
[RISCV] Use ComputeNumSignBits/MaskedValueIsZero in RISCVDAGToDAGISel…
Thu, Jun 10, 7:18 PM
craig.topper closed D104079: [RISCV] Use ComputeNumSignBits/MaskedValueIsZero in RISCVDAGToDAGISel::selectSExti32/selectZExti32..
Thu, Jun 10, 7:18 PM · Restricted Project
craig.topper added inline comments to D104079: [RISCV] Use ComputeNumSignBits/MaskedValueIsZero in RISCVDAGToDAGISel::selectSExti32/selectZExti32..
Thu, Jun 10, 6:58 PM · Restricted Project
craig.topper requested review of D104079: [RISCV] Use ComputeNumSignBits/MaskedValueIsZero in RISCVDAGToDAGISel::selectSExti32/selectZExti32..
Thu, Jun 10, 5:11 PM · Restricted Project
craig.topper committed rGb35a842581f0: [RISCV] Add test cases that show failure to use some W instructions if they are… (authored by craig.topper).
[RISCV] Add test cases that show failure to use some W instructions if they are…
Thu, Jun 10, 4:56 PM
craig.topper added reviewers for D79521: [RISCV] Add SiFive's interrupt modes: kito-cheng, asb, luismarques, craig.topper.
Thu, Jun 10, 4:45 PM · Restricted Project
craig.topper added a comment to D104061: [LangRef] clarify the meaning of noimplicitfloat.

That's a good point, if this attribute disables vectorization of integer math, the docs should say as much.

Thu, Jun 10, 4:07 PM · Restricted Project
craig.topper added a comment to D104061: [LangRef] clarify the meaning of noimplicitfloat.

This matches my understanding too. At least on X86, I think "floating-point" also includes integer SSE. Should we mention that?

Thu, Jun 10, 3:59 PM · Restricted Project
craig.topper requested review of D104069: [RISCV] Teach vsetvli insertion to remember when predecessors have same AVL and SEW/LMUL ratio if their VTYPEs otherwise mismatch..
Thu, Jun 10, 3:28 PM · Restricted Project
craig.topper added inline comments to D104043: [IR] Value: Fix OpCode checks.
Thu, Jun 10, 11:59 AM · Restricted Project
craig.topper accepted D99355: Implementation of intrinsic and SDNode definitions for VP load, store, gather, scatter..

LGTM

Thu, Jun 10, 11:15 AM · Restricted Project, Restricted Project

Wed, Jun 9

craig.topper added inline comments to D103880: [SDAG] Fix pow2 assumption when splitting vectors.
Wed, Jun 9, 10:01 PM · Restricted Project
craig.topper added inline comments to D103979: [lld-macho] Have dead-stripping work with literal sections.
Wed, Jun 9, 9:31 PM · Restricted Project, Restricted Project
craig.topper committed rG8dfd0810f240: [RISCV] Remove unused method from RISCVInsertVSETVLI. NFC (authored by craig.topper).
[RISCV] Remove unused method from RISCVInsertVSETVLI. NFC
Wed, Jun 9, 3:36 PM
craig.topper added a comment to D103898: [VP] Vector predicated vector splice intrinsic.

Are evl1 and evl2 likely to be the same value? Do you have an example when they would be different?

Wed, Jun 9, 2:41 PM · Restricted Project, Restricted Project
craig.topper added a comment to D99355: Implementation of intrinsic and SDNode definitions for VP load, store, gather, scatter..

LGTM too. Other than the last comments from Fraser and I.

Wed, Jun 9, 2:27 PM · Restricted Project, Restricted Project
craig.topper added inline comments to D93470: [VP] Binary floating-point intrinsics..
Wed, Jun 9, 2:19 PM · Restricted Project, Restricted Project
craig.topper added inline comments to D99355: Implementation of intrinsic and SDNode definitions for VP load, store, gather, scatter..
Wed, Jun 9, 7:45 AM · Restricted Project, Restricted Project
craig.topper added a reviewer for D99355: Implementation of intrinsic and SDNode definitions for VP load, store, gather, scatter.: craig.topper.
Wed, Jun 9, 7:42 AM · Restricted Project, Restricted Project
craig.topper committed rG765ef4bb2af6: [X86] Check destination element type before forming VTRUNCS/VTRUNCUS in… (authored by craig.topper).
[X86] Check destination element type before forming VTRUNCS/VTRUNCUS in…
Wed, Jun 9, 7:16 AM
craig.topper closed D103940: [X86] Check destination element type before forming VTRUNCS/VTRUNCUS in combineTruncateWithSat..
Wed, Jun 9, 7:16 AM · Restricted Project

Tue, Jun 8

craig.topper requested review of D103940: [X86] Check destination element type before forming VTRUNCS/VTRUNCUS in combineTruncateWithSat..
Tue, Jun 8, 10:41 PM · Restricted Project
craig.topper added a comment to D73607: [X86] Custom lower ISD::FROUND with SSE4.1 to avoid a libcall..

I ran across a llvm_unreachable that points to this commit. Repro instructions below:

test.ii

double compare1(double x, double y) { return ((int)x< y) ? x : y; }
double compare2(double x, double y) { return y != 0.0 ? y : x; }

int compareint(int x, int y, int z) { return (x < y) ? y : (z < x) ? z : x; }

class C {
public:
  C(double arg) { 
    constexpr int k1 = -(1 << 23); 
    constexpr int k2 = (1 << 23) - 1;
    array[0] = compareint(arg, k1, k2);
  }
  
  char array[3];
};
extern "C" double round(double);
constexpr double kEight = 8;

C create(int b) {
  double d1 = b * kEight;
  double d2 = round(d1);
  double d3 = compare1(0.0, d2);
  double d4 = compare2(0.0, d3);
  return C(d4);
}

void loop(int* b, C *ptr, long j) {
  for (int i = 0; i < j; ++i)
    ptr[i] = create(b[i]);
}

clang command:

clang \
"-cc1" \
"-triple" "x86_64-unknown-linux-gnu" \
"-emit-obj" \
"-target-cpu" "x86-64" \
"-target-feature" "+avx" \
"-target-feature" "+avx2" \
"-target-feature" "+avx512f" \
"-O3" \
"-vectorize-loops" \
"-x" "c++" "test.ii"

output:

PromoteIntegerResult #0: t177: v16i24 = X86ISD::VTRUNCS t216

Do not know how to promote this operator!
UNREACHABLE executed at llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp:54!

0.	Program arguments: clang -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -target-cpu x86-64 -target-feature +avx -target-feature +avx2 -target-feature +avx512f -O3 -vectorize-loops -x c++ test.ii
1.	<eof> parser at end of file
2.	Code generation
3.	Running pass 'Function Pass Manager' on module 'test.ii'.
4.	Running pass 'X86 DAG->DAG Instruction Selection' on function '@_Z4loopPiP1Cl'
Tue, Jun 8, 10:18 PM · Restricted Project
craig.topper added inline comments to D103935: Add Twine support for std::string_view..
Tue, Jun 8, 5:19 PM · Restricted Project
craig.topper added inline comments to D103935: Add Twine support for std::string_view..
Tue, Jun 8, 5:09 PM · Restricted Project
craig.topper added inline comments to D101469: [RISCV] Enable interleaved vectorization for RVV.
Tue, Jun 8, 11:57 AM · Restricted Project
craig.topper added inline comments to D101469: [RISCV] Enable interleaved vectorization for RVV.
Tue, Jun 8, 11:56 AM · Restricted Project
craig.topper committed rGc09b37553e74: [RISCV] Remove dead code from fixed-vectors-abs.ll test cases. NFC (authored by craig.topper).
[RISCV] Remove dead code from fixed-vectors-abs.ll test cases. NFC
Tue, Jun 8, 11:25 AM
craig.topper accepted D103884: [ValueTypes][RISCV] Cap RVV fixed-length vectors by size.

LGTM

Tue, Jun 8, 10:13 AM · Restricted Project
craig.topper accepted D103883: [ValueTypes] Add missing enum names for MVTs.

LGTM

Tue, Jun 8, 10:09 AM · Restricted Project
craig.topper accepted D103893: [NFC] Reformat MachineValueType.

LGTM. Thanks!

Tue, Jun 8, 9:53 AM · Restricted Project
craig.topper accepted D103896: [RISCV] Support CONCAT_VECTORS on scalable masks.

LGTM

Tue, Jun 8, 9:52 AM · Restricted Project
craig.topper committed rG8b4c80d380a6: Further improve register allocation for vwadd(u).wv, vwsub(u).wv, vfwadd.wv… (authored by craig.topper).
Further improve register allocation for vwadd(u).wv, vwsub(u).wv, vfwadd.wv…
Tue, Jun 8, 9:44 AM
craig.topper closed D103552: Further improve register allocation for vwadd(u).wv, vwsub(u).wv, vfwadd.wv, and vfwsub.wv..
Tue, Jun 8, 9:44 AM · Restricted Project
craig.topper committed rGc57bce9cc5fa: [RISCV] Remove ForceTailAgnostic flag from vmv.s.x, vfmv.s.f and reductions. (authored by craig.topper).
[RISCV] Remove ForceTailAgnostic flag from vmv.s.x, vfmv.s.f and reductions.
Tue, Jun 8, 9:23 AM
craig.topper closed D103736: [RISCV] Remove ForceTailAgnostic flag from vmv.s.x, vfmv.s.f and reductions..
Tue, Jun 8, 9:23 AM · Restricted Project

Mon, Jun 7

craig.topper updated the diff for D103552: Further improve register allocation for vwadd(u).wv, vwsub(u).wv, vfwadd.wv, and vfwsub.wv..

Use AVL instead of GPR. Use VLOpFrag

Mon, Jun 7, 10:57 PM · Restricted Project
craig.topper committed rG7c4e9a68264f: [RISCV] Use 0 for Log2SEW for vle1/vse1 intrinsics to enable vsetvli… (authored by craig.topper).
[RISCV] Use 0 for Log2SEW for vle1/vse1 intrinsics to enable vsetvli…
Mon, Jun 7, 10:45 PM
craig.topper committed rGae3ab4f0ec61: [RISCV] Masked compares should use a tail agnostic policy. (authored by craig.topper).
[RISCV] Masked compares should use a tail agnostic policy.
Mon, Jun 7, 9:56 PM
craig.topper closed D103331: [RISCV] Masked compares should use a tail agnostic policy..
Mon, Jun 7, 9:56 PM · Restricted Project
craig.topper committed rG7a105b576857: [RISCV] Use AVL Operand instead of GPR for tied mask pseudo for vwadd.wv and… (authored by craig.topper).
[RISCV] Use AVL Operand instead of GPR for tied mask pseudo for vwadd.wv and…
Mon, Jun 7, 9:17 PM
craig.topper added inline comments to D103552: Further improve register allocation for vwadd(u).wv, vwsub(u).wv, vfwadd.wv, and vfwsub.wv..
Mon, Jun 7, 9:07 PM · Restricted Project
craig.topper committed rG0aa941654fc0: [RISCV] Use bitfields to shrink the size of the vector load/store intrinsics to… (authored by craig.topper).
[RISCV] Use bitfields to shrink the size of the vector load/store intrinsics to…
Mon, Jun 7, 5:58 PM
craig.topper committed rG9b92ae01ee57: [RISCV] Store Log2 of EEW in the vector load/store intrinsic to pseudo lookup… (authored by craig.topper).
[RISCV] Store Log2 of EEW in the vector load/store intrinsic to pseudo lookup…
Mon, Jun 7, 3:48 PM
craig.topper added inline comments to D99355: Implementation of intrinsic and SDNode definitions for VP load, store, gather, scatter..
Mon, Jun 7, 3:32 PM · Restricted Project, Restricted Project
craig.topper added inline comments to D103251: [NFC] Fix semantic discrepancy for MVT::LAST_VALUETYPE.
Mon, Jun 7, 3:24 PM · Restricted Project
craig.topper added a comment to D103756: [DAG] Allow isNullOrNullSplat to see truncated zeroes.

RISCV changes LGTM

Mon, Jun 7, 3:20 PM · Restricted Project
craig.topper added inline comments to D103820: [X86] Prefer vpmovq2m over vpternlogd + vpcmpgtq.
Mon, Jun 7, 11:08 AM · Restricted Project
craig.topper accepted D103790: [RISCV][NFC] Add a single space after comma for VType.

LGTM

Mon, Jun 7, 10:48 AM · Restricted Project
craig.topper accepted D102686: [VP] getDeclarationForParams.

LGTM

Mon, Jun 7, 10:44 AM · Restricted Project, Restricted Project
craig.topper committed rGf30f8b4f12b7: [RISCV] Lower i8/i16 bswap/bitreverse to grevi/greviw with Zbp. (authored by craig.topper).
[RISCV] Lower i8/i16 bswap/bitreverse to grevi/greviw with Zbp.
Mon, Jun 7, 10:32 AM
craig.topper closed D103757: [RISCV] Lower i8/i16 bswap/bitreverse to grevi/greviw with Zbp..
Mon, Jun 7, 10:32 AM · Restricted Project
craig.topper accepted D103743: [RISCV] Optimize bitwise and with constant for the Zbs extension.

LGTM

Mon, Jun 7, 10:29 AM · Restricted Project
craig.topper committed rG8c6bd6c22f38: [RISCV] Don't enable loop vectorizer interleaving if the V extension isn't… (authored by craig.topper).
[RISCV] Don't enable loop vectorizer interleaving if the V extension isn't…
Mon, Jun 7, 10:21 AM
craig.topper closed D103787: [RISCV] Don't enable loop vectorizer interleaving if the V extension isn't enabled..
Mon, Jun 7, 10:21 AM · Restricted Project
craig.topper added inline comments to D103820: [X86] Prefer vpmovq2m over vpternlogd + vpcmpgtq.
Mon, Jun 7, 10:20 AM · Restricted Project
craig.topper added a comment to D103820: [X86] Prefer vpmovq2m over vpternlogd + vpcmpgtq.

Actually, wait. Something weird is going on at the mid-level. These two functions should generate the same optimized IR, right?

typedef int V __attribute__((vector_size(64)));

V lt_zero_x_y(V mask, V x, V y) { return mask <  0 ? x : y; }
V ge_zero_y_x(V mask, V x, V y) { return mask >= 0 ? y : x; }
Mon, Jun 7, 10:07 AM · Restricted Project
craig.topper added a comment to D103743: [RISCV] Optimize bitwise and with constant for the Zbs extension.

Are you planning on extending this to use bclriw on RV64? (Would that clash with the use of tablegen? Personally, I tend to find C++ custom lowering of longer stuff easier to read and more cohesive, not sure how others feel)

I have not consider BSETIW/BINVIW/BCLRIW, maybe I will do it in next patch. And this patch will just focuses on BCLRI.

I do not like C++ custom lowering for that, since it needs even more lines than current form.

Mon, Jun 7, 8:29 AM · Restricted Project
craig.topper added a reviewer for D103790: [RISCV][NFC] Add a single space after comma for VType: kito-cheng.

The examples in the V spec show no spaces. Are you going to update that too? What about binutils?

Mon, Jun 7, 12:17 AM · Restricted Project

Sun, Jun 6

craig.topper requested review of D103787: [RISCV] Don't enable loop vectorizer interleaving if the V extension isn't enabled..
Sun, Jun 6, 11:33 PM · Restricted Project
craig.topper added a comment to D101469: [RISCV] Enable interleaved vectorization for RVV.

I just noticed that this enabled interleaving in the loop vectorizer even when the V extension isn't enabled. So we now generate interleaved scalar code in some cases. Was that intentional?

Sun, Jun 6, 11:13 PM · Restricted Project
craig.topper committed rG8bde5f06a11d: [RISCV] Replace && with ||. Spotted by coverity. (authored by craig.topper).
[RISCV] Replace && with ||. Spotted by coverity.
Sun, Jun 6, 1:25 PM
craig.topper added inline comments to D96661: [RISCV] Move SHFLI matching to DAG combine. Add 32-bit support for RV64.
Sun, Jun 6, 12:07 PM · Restricted Project

Sat, Jun 5

craig.topper requested review of D103758: [RISCV] Use ZeroOrNegativeOneBooleanContent for vectors..
Sat, Jun 5, 1:12 PM · Restricted Project
craig.topper added inline comments to D103693: [RISCV] Add support for BUILD_VECTOR, VECTOR_SHUFFLE and INSERT_VECTOR_ELT for RVP.
Sat, Jun 5, 12:59 PM · Restricted Project
craig.topper added inline comments to D103742: [RISCV] Support vector maximum and minimum for RVP.
Sat, Jun 5, 12:46 PM · Restricted Project
craig.topper added inline comments to D103740: [RISCV] Support vector comparision for RVP.
Sat, Jun 5, 12:44 PM · Restricted Project
craig.topper added inline comments to D103743: [RISCV] Optimize bitwise and with constant for the Zbs extension.
Sat, Jun 5, 12:38 PM · Restricted Project
craig.topper updated the diff for D103757: [RISCV] Lower i8/i16 bswap/bitreverse to grevi/greviw with Zbp..

clang-format

Sat, Jun 5, 12:35 PM · Restricted Project
craig.topper requested review of D103757: [RISCV] Lower i8/i16 bswap/bitreverse to grevi/greviw with Zbp..
Sat, Jun 5, 12:34 PM · Restricted Project
craig.topper added a comment to D103510: [RISCV] Use vmv.v.[v|i] if we know COPY is under the same vl and vtype..

My browser's really chugging on this huge patch so my input has to be brief. Maybe we could hide the test changes for now?

Regarding vmv.v.i, is there not already some support for rematerialization (e.g. of immediates)? Or is it non-trivial due to having to manage VSETVLIs?

There seems no support for rematerialization for vmv.v.i. Do you mean to set isReMaterializable = 1, isAsCheapAsAMove = 1 to vmv.v.i pseudo instructions?

Sat, Jun 5, 9:38 AM · Restricted Project

Fri, Jun 4

craig.topper requested review of D103736: [RISCV] Remove ForceTailAgnostic flag from vmv.s.x, vfmv.s.f and reductions..
Fri, Jun 4, 9:33 PM · Restricted Project
craig.topper added inline comments to D103510: [RISCV] Use vmv.v.[v|i] if we know COPY is under the same vl and vtype..
Fri, Jun 4, 9:00 PM · Restricted Project
craig.topper added inline comments to D103510: [RISCV] Use vmv.v.[v|i] if we know COPY is under the same vl and vtype..
Fri, Jun 4, 6:49 PM · Restricted Project
craig.topper added inline comments to D103697: [RISCV] Pre-commit test for D103698.
Fri, Jun 4, 4:21 PM · Restricted Project
craig.topper added inline comments to D103698: [RISCV] Add support for CLTZ for RVP.
Fri, Jun 4, 4:21 PM · Restricted Project
craig.topper added inline comments to D103689: [RISCV] Add support for BSWAP for RVP.
Fri, Jun 4, 4:02 PM · Restricted Project
craig.topper added inline comments to D103691: [RISCV] Add support for BITREVERSE for RVP.
Fri, Jun 4, 3:57 PM · Restricted Project
craig.topper accepted D103682: [RISCV] Replace (XLenVT (VLOp GPR:$vl)) with VLOpFrag.

LGTM

Fri, Jun 4, 3:27 PM · Restricted Project
craig.topper updated the diff for D103331: [RISCV] Masked compares should use a tail agnostic policy..

Rebase

Fri, Jun 4, 10:35 AM · Restricted Project
craig.topper added inline comments to D102822: [Clang][CodeGen] Set the size of llvm.lifetime to unknown for scalable types..
Fri, Jun 4, 9:29 AM · Restricted Project
craig.topper committed rGc653711fd3a9: [RISCV] Teach vsetvli insertion pass that operations on masks don't care about… (authored by craig.topper).
[RISCV] Teach vsetvli insertion pass that operations on masks don't care about…
Fri, Jun 4, 9:18 AM
craig.topper closed D103299: [RISCV] Teach vsetvli insertion pass that operations on masks don't care about SEW/LMUL..
Fri, Jun 4, 9:18 AM · Restricted Project

Thu, Jun 3

craig.topper committed rGe9313fa33ae5: [RISCV] Simplify some code in RISCVInsertVSETVLI by calling an existing… (authored by craig.topper).
[RISCV] Simplify some code in RISCVInsertVSETVLI by calling an existing…
Thu, Jun 3, 5:49 PM
craig.topper added inline comments to D103246: [SelectionDAG] Extend FoldConstantVectorArithmetic to SPLAT_VECTOR.
Thu, Jun 3, 5:47 PM · Restricted Project
craig.topper accepted D103246: [SelectionDAG] Extend FoldConstantVectorArithmetic to SPLAT_VECTOR.

LGTM

Thu, Jun 3, 5:37 PM · Restricted Project
craig.topper added inline comments to D99675: [llvm][clang] Create new intrinsic llvm.arithmetic.fence to control FP optimization at expression level.
Thu, Jun 3, 10:15 AM · Restricted Project