diff options
author | Michael Liao <michael.hliao@gmail.com> | 2023-12-16 09:14:35 -0500 |
---|---|---|
committer | Michael Liao <michael.hliao@gmail.com> | 2023-12-18 15:07:12 -0500 |
commit | 2a8f40d4628d9ee070114b5550e2b20e35667a54 (patch) | |
tree | 703b394e47944190804f7e7af374ec0d65589751 | |
parent | da2db4a9e833804384c1fa56af77b6953e3afa23 (diff) | |
download | llvm-2a8f40d4628d9ee070114b5550e2b20e35667a54.zip llvm-2a8f40d4628d9ee070114b5550e2b20e35667a54.tar.gz llvm-2a8f40d4628d9ee070114b5550e2b20e35667a54.tar.bz2 |
[RISCV][GISel] Fix a bug exposed from compilation warnings. NFC
- G_MERGE_VALUES and G_UNMERGE_VALUES need type pairs instead of type.
-rw-r--r-- | llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp b/llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp index 8f03a7a..dbbe335 100644 --- a/llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp +++ b/llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp @@ -85,13 +85,13 @@ RISCVLegalizerInfo::RISCVLegalizerInfo(const RISCVSubtarget &ST) // Merge/Unmerge for (unsigned Op : {G_MERGE_VALUES, G_UNMERGE_VALUES}) { - unsigned BigTyIdx = Op == G_MERGE_VALUES ? 0 : 1; - unsigned LitTyIdx = Op == G_MERGE_VALUES ? 1 : 0; + unsigned BigTyIdx = (Op == G_MERGE_VALUES) ? 0 : 1; + unsigned LitTyIdx = (Op == G_MERGE_VALUES) ? 1 : 0; auto &MergeUnmergeActions = getActionDefinitionsBuilder(Op); if (XLen == 32 && ST.hasStdExtD()) { - LLT IdxZeroTy = G_MERGE_VALUES ? s64 : s32; - LLT IdxOneTy = G_MERGE_VALUES ? s32 : s64; - MergeUnmergeActions.legalFor({IdxZeroTy, IdxOneTy}); + LLT IdxZeroTy = (Op == G_MERGE_VALUES) ? s64 : s32; + LLT IdxOneTy = (Op == G_MERGE_VALUES) ? s32 : s64; + MergeUnmergeActions.legalFor({{IdxZeroTy, IdxOneTy}}); } MergeUnmergeActions.widenScalarToNextPow2(LitTyIdx, XLen) .widenScalarToNextPow2(BigTyIdx, XLen) |