Skip to content

Commit 47ff60c

Browse files
SC llvm teamSC llvm team
authored andcommitted
Merged main:a9183b8899f2c02ba3710b27c0cbdde6831a627b into amd-gfx:54b8c4105b11
Local branch amd-gfx 54b8c41 Merged main:918ac62916d48649f224f8c54837d25baff97a08 into amd-gfx:0825d3bdd658 Remote branch main a9183b8 [X86][MC] Fix encoding bug for CCMP introduced in llvm#85175
2 parents 54b8c41 + a9183b8 commit 47ff60c

File tree

40 files changed

+304
-241
lines changed

40 files changed

+304
-241
lines changed

clang-tools-extra/clang-tidy/misc/UseInternalLinkageCheck.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,12 @@ void UseInternalLinkageCheck::check(const MatchFinder::MatchResult &Result) {
121121
return;
122122
}
123123
if (const auto *VD = Result.Nodes.getNodeAs<VarDecl>("var")) {
124+
// In C++, const variables at file scope have implicit internal linkage,
125+
// so we should not warn there. This is not the case in C.
126+
// https://eel.is/c++draft/diff#basic-3
127+
if (getLangOpts().CPlusPlus && VD->getType().isConstQualified())
128+
return;
129+
124130
DiagnosticBuilder DB = diag(VD->getLocation(), Message) << "variable" << VD;
125131
SourceLocation FixLoc = VD->getTypeSpecStartLoc();
126132
if (FixLoc.isInvalid() || FixLoc.isMacroID())

clang-tools-extra/test/clang-tidy/checkers/misc/use-internal-linkage-var.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,6 @@ int global_in_extern_c_1;
4242
}
4343

4444
extern "C" int global_in_extern_c_2;
45+
46+
const int const_global = 123;
47+
constexpr int constexpr_global = 123;

clang/test/CodeGen/isfpclass.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ typedef double __attribute__((ext_vector_type(4))) double4;
136136
typedef int __attribute__((ext_vector_type(4))) int4;
137137
typedef long __attribute__((ext_vector_type(4))) long4;
138138

139-
// CHECK-LABEL: define dso_local noundef <4 x i32> @check_isfpclass_nan_v4f32
139+
// CHECK-LABEL: define dso_local range(i32 0, 2) <4 x i32> @check_isfpclass_nan_v4f32
140140
// CHECK-SAME: (<4 x float> noundef [[X:%.*]]) local_unnamed_addr #[[ATTR0]] {
141141
// CHECK-NEXT: entry:
142142
// CHECK-NEXT: [[TMP0:%.*]] = fcmp uno <4 x float> [[X]], zeroinitializer
@@ -147,7 +147,7 @@ int4 check_isfpclass_nan_v4f32(float4 x) {
147147
return __builtin_isfpclass(x, 3 /*NaN*/);
148148
}
149149

150-
// CHECK-LABEL: define dso_local noundef <4 x i32> @check_isfpclass_nan_strict_v4f32
150+
// CHECK-LABEL: define dso_local range(i32 0, 2) <4 x i32> @check_isfpclass_nan_strict_v4f32
151151
// CHECK-SAME: (<4 x float> noundef [[X:%.*]]) local_unnamed_addr #[[ATTR2]] {
152152
// CHECK-NEXT: entry:
153153
// CHECK-NEXT: [[TMP0:%.*]] = tail call <4 x i1> @llvm.is.fpclass.v4f32(<4 x float> [[X]], i32 3) #[[ATTR5]]

flang/test/Lower/OpenMP/distribute-simd.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ subroutine distribute_simd_aligned(A)
1515
! CHECK-SAME: {
1616
! CHECK-NEXT: omp.simd
1717
! CHECK-SAME: aligned({{.*}})
18-
!$omp distribute simd aligned(A)
18+
!$omp distribute simd aligned(A:256)
1919
do index_ = 1, 10
2020
call c_test_call(A)
2121
end do

flang/test/Lower/OpenMP/wsloop-simd.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ subroutine do_simd_aligned(A)
1313
! CHECK-SAME: {
1414
! CHECK-NEXT: omp.simd
1515
! CHECK-SAME: aligned({{.*}})
16-
!$omp do simd aligned(A)
16+
!$omp do simd aligned(A:256)
1717
do index_ = 1, 10
1818
call c_test_call(A)
1919
end do

libc/src/math/generic/cospif.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ LLVM_LIBC_FUNCTION(float, cospif, (float x)) {
2121
using FPBits = typename fputil::FPBits<float>;
2222

2323
FPBits xbits(x);
24-
Sign xsign = xbits.sign();
2524
xbits.set_sign(Sign::POS);
2625

2726
uint32_t x_abs = xbits.uintval();
@@ -86,7 +85,7 @@ LLVM_LIBC_FUNCTION(float, cospif, (float x)) {
8685
sincospif_eval(xd, sin_k, cos_k, sin_y, cosm1_y);
8786

8887
if (LIBC_UNLIKELY(sin_y == 0 && cos_k == 0)) {
89-
return FPBits::zero(xsign).get_val();
88+
return 0.0f;
9089
}
9190

9291
return static_cast<float>(fputil::multiply_add(

libc/src/stdio/baremetal/getchar.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
#include "src/stdio/getchar.h"
1010
#include "src/__support/OSUtil/io.h"
1111

12-
#include <stdio.h>
13-
1412
namespace LIBC_NAMESPACE {
1513

1614
LLVM_LIBC_FUNCTION(int, getchar, ()) {

libc/src/stdio/puts.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
#ifndef LLVM_LIBC_SRC_STDIO_PUTS_H
1010
#define LLVM_LIBC_SRC_STDIO_PUTS_H
1111

12-
#include <stdio.h>
13-
1412
namespace LIBC_NAMESPACE {
1513

1614
int puts(const char *__restrict str);

libc/test/src/math/cospif_test.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,10 @@ TEST_F(LlvmLibcCospifTest, SpecialNumbers) {
3838
}
3939

4040
TEST_F(LlvmLibcCospifTest, SpecificBitPatterns) {
41-
constexpr int N = 36;
41+
constexpr int N = 38;
4242
constexpr uint32_t INPUTS[N] = {
43+
0x3f00'0000U, // x = 0.5
44+
0x461d'd600U, // x = 10101.5
4345
0x3f06'0a92U, // x = pi/6
4446
0x3f3a'dc51U, // x = 0x1.75b8a2p-1f
4547
0x3f49'0fdbU, // x = pi/4
@@ -108,13 +110,12 @@ TEST_F(LlvmLibcCospifTest, SDCOMP_26094) {
108110
}
109111
}
110112

111-
// sinpi(-n) = -0.0
112-
// sinpi(+n) = +0.0
113+
// sinpi(+n + 0.5) = sinpi(-n + 0.5) = +0.0
113114
TEST_F(LlvmLibcCospifTest, SignedZeros) {
114115
EXPECT_FP_EQ(0.0, LIBC_NAMESPACE::cospif(100.5f));
115-
EXPECT_FP_EQ(-0.0, LIBC_NAMESPACE::cospif(-100.5f));
116+
EXPECT_FP_EQ(0.0, LIBC_NAMESPACE::cospif(-100.5f));
116117
EXPECT_FP_EQ(0.0, LIBC_NAMESPACE::cospif(45678.5f));
117-
EXPECT_FP_EQ(-0.0, LIBC_NAMESPACE::cospif(-45678.5f));
118+
EXPECT_FP_EQ(0.0, LIBC_NAMESPACE::cospif(-45678.5f));
118119
EXPECT_FP_EQ(0.0, LIBC_NAMESPACE::cospif(8000000.5f));
119-
EXPECT_FP_EQ(-0.0, LIBC_NAMESPACE::cospif(-8000000.5f));
120+
EXPECT_FP_EQ(0.0, LIBC_NAMESPACE::cospif(-8000000.5f));
120121
}

libcxx/docs/Status/Cxx2cIssues.csv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"","","","","",""
6565
"`3944 <https://wg21.link/LWG3944>`__","Formatters converting sequences of ``char`` to sequences of ``wchar_t``","St. Louis June 2024","","","|format|"
6666
"`4060 <https://wg21.link/LWG4060>`__","``submdspan`` preconditions do not forbid creating invalid pointer","St. Louis June 2024","","",""
67-
"`4061 <https://wg21.link/LWG4061>`__","Should ``std::basic_format_context`` be default-constructible/copyable/movable?","St. Louis June 2024","","","|format|"
67+
"`4061 <https://wg21.link/LWG4061>`__","Should ``std::basic_format_context`` be default-constructible/copyable/movable?","St. Louis June 2024","|Complete|","19.0","|format|"
6868
"`4071 <https://wg21.link/LWG4071>`__","``reference_wrapper`` comparisons are not SFINAE-friendly","St. Louis June 2024","|Complete|","19.0",""
6969
"`4074 <https://wg21.link/LWG4074>`__","``compatible-joinable-ranges`` is underconstrained","St. Louis June 2024","","","|ranges|"
7070
"`4076 <https://wg21.link/LWG4076>`__","``concat_view`` should be freestanding","St. Louis June 2024","","",""
@@ -74,7 +74,7 @@
7474
"`4096 <https://wg21.link/LWG4096>`__","``views::iota(views::iota(0))`` should be rejected","St. Louis June 2024","","","|ranges|"
7575
"`4098 <https://wg21.link/LWG4098>`__","``views::adjacent<0>`` should reject non-forward ranges","St. Louis June 2024","","","|ranges|"
7676
"`4105 <https://wg21.link/LWG4105>`__","``ranges::ends_with``\`s Returns misses difference casting","St. Louis June 2024","","","|ranges|"
77-
"`4106 <https://wg21.link/LWG4106>`__","``basic_format_args`` should not be default-constructible","St. Louis June 2024","","","|format|"
77+
"`4106 <https://wg21.link/LWG4106>`__","``basic_format_args`` should not be default-constructible","St. Louis June 2024","|Complete|","19.0","|format|"
7878
"","","","","",""
7979
"`3343 <https://wg21.link/LWG3343>`__","Ordering of calls to ``unlock()`` and ``notify_all()`` in Effects element of ``notify_all_at_thread_exit()`` should be reversed","Not Yet Adopted","|Complete|","16.0",""
8080
"XXXX","","The sys_info range should be affected by save","Not Yet Adopted","|Complete|","19.0"

libcxx/include/__format/format_args.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2828
template <class _Context>
2929
class _LIBCPP_TEMPLATE_VIS basic_format_args {
3030
public:
31-
basic_format_args() noexcept = default;
32-
3331
template <class... _Args>
3432
_LIBCPP_HIDE_FROM_ABI basic_format_args(const __format_arg_store<_Context, _Args...>& __store) noexcept
3533
: __size_(sizeof...(_Args)) {

libcxx/include/__format/format_context.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ class
131131
_LIBCPP_HIDE_FROM_ABI explicit basic_format_context(_OutIt __out_it, basic_format_args<basic_format_context> __args)
132132
: __out_it_(std::move(__out_it)), __args_(__args) {}
133133
# endif
134+
135+
basic_format_context(const basic_format_context&) = delete;
136+
basic_format_context& operator=(const basic_format_context&) = delete;
134137
};
135138

136139
// A specialization for __retarget_buffer

libcxx/test/std/utilities/format/format.arguments/format.args/ctor.pass.cpp

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

1010
// <format>
1111

12-
// basic_format_args() noexcept;
1312
// template<class... Args>
1413
// basic_format_args(const format-arg-store<Context, Args...>& store) noexcept;
1514

1615
#include <format>
1716
#include <cassert>
17+
#include <type_traits>
1818

1919
#include "test_macros.h"
2020

@@ -24,12 +24,7 @@ void test() {
2424
char c = 'c';
2525
nullptr_t p = nullptr;
2626
using Context = std::basic_format_context<CharT*, CharT>;
27-
{
28-
ASSERT_NOEXCEPT(std::basic_format_args<Context>{});
29-
30-
std::basic_format_args<Context> format_args{};
31-
assert(!format_args.get(0));
32-
}
27+
static_assert(!std::is_default_constructible_v<std::basic_format_args<Context>>);
3328
{
3429
auto store = std::make_format_args<Context>(i);
3530
ASSERT_NOEXCEPT(std::basic_format_args<Context>{store});

libcxx/test/std/utilities/format/format.arguments/format.args/get.pass.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,7 @@ void test_string_view(From value) {
8181

8282
template <class CharT>
8383
void test() {
84-
using Context = std::basic_format_context<CharT*, CharT>;
85-
{
86-
const std::basic_format_args<Context> format_args{};
87-
ASSERT_NOEXCEPT(format_args.get(0));
88-
assert(!format_args.get(0));
89-
}
90-
84+
using Context = std::basic_format_context<CharT*, CharT>;
9185
using char_type = typename Context::char_type;
9286
std::basic_string<char_type> empty;
9387
std::basic_string<char_type> str = MAKE_STRING(char_type, "abc");

libcxx/test/std/utilities/format/format.formatter/format.context/format.context/ctor.pass.cpp

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,19 +112,27 @@ void test() {
112112
#endif
113113
}
114114

115+
// The default constructor is suppressed by the deleted copy operations.
116+
// The move operations are implicitly deleted due to the deleted copy operations.
117+
115118
// std::back_insert_iterator<std::string>, copyable
116-
static_assert(std::is_copy_constructible_v<std::basic_format_context<std::back_insert_iterator<std::string>, char>>);
117-
static_assert(std::is_copy_assignable_v<std::basic_format_context<std::back_insert_iterator<std::string>, char>>);
119+
static_assert(
120+
!std::is_default_constructible_v<std::basic_format_context<std::back_insert_iterator<std::string>, char>>);
121+
122+
static_assert(!std::is_copy_constructible_v<std::basic_format_context<std::back_insert_iterator<std::string>, char>>);
123+
static_assert(!std::is_copy_assignable_v<std::basic_format_context<std::back_insert_iterator<std::string>, char>>);
118124

119-
static_assert(std::is_move_constructible_v<std::basic_format_context<std::back_insert_iterator<std::string>, char>>);
120-
static_assert(std::is_move_assignable_v<std::basic_format_context<std::back_insert_iterator<std::string>, char>>);
125+
static_assert(!std::is_move_constructible_v<std::basic_format_context<std::back_insert_iterator<std::string>, char>>);
126+
static_assert(!std::is_move_assignable_v<std::basic_format_context<std::back_insert_iterator<std::string>, char>>);
121127

122128
// cpp20_output_iterator, move only
129+
static_assert(!std::is_default_constructible_v<std::basic_format_context<cpp20_output_iterator<int*>, char>>);
130+
123131
static_assert(!std::is_copy_constructible_v<std::basic_format_context<cpp20_output_iterator<int*>, char>>);
124132
static_assert(!std::is_copy_assignable_v<std::basic_format_context<cpp20_output_iterator<int*>, char>>);
125133

126-
static_assert(std::is_move_constructible_v<std::basic_format_context<cpp20_output_iterator<int*>, char>>);
127-
static_assert(std::is_move_assignable_v<std::basic_format_context<cpp20_output_iterator<int*>, char>>);
134+
static_assert(!std::is_move_constructible_v<std::basic_format_context<cpp20_output_iterator<int*>, char>>);
135+
static_assert(!std::is_move_assignable_v<std::basic_format_context<cpp20_output_iterator<int*>, char>>);
128136

129137
int main(int, char**) {
130138
test<std::back_insert_iterator<std::basic_string<char>>, char>();

libcxx/test/std/utilities/format/format.functions/bug_81590.compile.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ struct X : std::variant<X*> {
2525

2626
template <>
2727
struct std::formatter<X, char> : std::formatter<std::string, char> {
28-
static constexpr auto format(const X& x, auto ctx) {
28+
static constexpr auto format(const X& x, auto& ctx) {
2929
if (!x.p)
3030
return ctx.out();
3131
auto m = [&](const X* t) { return std::format_to(ctx.out(), "{}", *t); };

llvm/include/llvm/Config/llvm-config.h.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
/* Indicate that this is LLVM compiled from the amd-gfx branch. */
1818
#define LLVM_HAVE_BRANCH_AMD_GFX
19-
#define LLVM_MAIN_REVISION 504307
19+
#define LLVM_MAIN_REVISION 504322
2020

2121
/* Define if LLVM_ENABLE_DUMP is enabled */
2222
#cmakedefine LLVM_ENABLE_DUMP

llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5551,8 +5551,7 @@ AArch64InstructionSelector::emitConstantVector(Register Dst, Constant *CV,
55515551
}
55525552

55535553
if (CV->getSplatValue()) {
5554-
APInt DefBits = APInt::getSplat(
5555-
DstSize, CV->getUniqueInteger().trunc(DstTy.getScalarSizeInBits()));
5554+
APInt DefBits = APInt::getSplat(DstSize, CV->getUniqueInteger());
55565555
auto TryMOVIWithBits = [&](APInt DefBits) -> MachineInstr * {
55575556
MachineInstr *NewOp;
55585557
bool Inv = false;

llvm/lib/Target/AArch64/GISel/AArch64RegisterBankInfo.cpp

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
#include "AArch64GenRegisterBankInfo.def"
4343

4444
using namespace llvm;
45-
static const unsigned CustomMappingID = 1;
4645

4746
AArch64RegisterBankInfo::AArch64RegisterBankInfo(
4847
const TargetRegisterInfo &TRI) {
@@ -425,27 +424,6 @@ void AArch64RegisterBankInfo::applyMappingImpl(
425424
MI.getOperand(2).setReg(Ext.getReg(0));
426425
return applyDefaultMapping(OpdMapper);
427426
}
428-
case AArch64::G_DUP: {
429-
// Extend smaller gpr to 32-bits
430-
assert(MRI.getType(MI.getOperand(1).getReg()).getSizeInBits() < 32 &&
431-
"Expected sources smaller than 32-bits");
432-
Builder.setInsertPt(*MI.getParent(), MI.getIterator());
433-
434-
Register ConstReg;
435-
auto ConstMI = MRI.getVRegDef(MI.getOperand(1).getReg());
436-
if (ConstMI->getOpcode() == TargetOpcode::G_CONSTANT) {
437-
auto CstVal = ConstMI->getOperand(1).getCImm()->getValue();
438-
ConstReg =
439-
Builder.buildConstant(LLT::scalar(32), CstVal.sext(32)).getReg(0);
440-
ConstMI->eraseFromParent();
441-
} else {
442-
ConstReg = Builder.buildAnyExt(LLT::scalar(32), MI.getOperand(1).getReg())
443-
.getReg(0);
444-
}
445-
MRI.setRegBank(ConstReg, getRegBank(AArch64::GPRRegBankID));
446-
MI.getOperand(1).setReg(ConstReg);
447-
return applyDefaultMapping(OpdMapper);
448-
}
449427
default:
450428
llvm_unreachable("Don't know how to handle that operation");
451429
}
@@ -814,13 +792,8 @@ AArch64RegisterBankInfo::getInstrMapping(const MachineInstr &MI) const {
814792
(getRegBank(ScalarReg, MRI, TRI) == &AArch64::FPRRegBank ||
815793
onlyDefinesFP(*ScalarDef, MRI, TRI)))
816794
OpRegBankIdx = {PMI_FirstFPR, PMI_FirstFPR};
817-
else {
818-
if (ScalarTy.getSizeInBits() < 32 &&
819-
getRegBank(ScalarReg, MRI, TRI) == &AArch64::GPRRegBank)
820-
// Calls applyMappingImpl()
821-
MappingID = CustomMappingID;
795+
else
822796
OpRegBankIdx = {PMI_FirstFPR, PMI_FirstGPR};
823-
}
824797
break;
825798
}
826799
case TargetOpcode::G_TRUNC: {
@@ -1042,8 +1015,7 @@ AArch64RegisterBankInfo::getInstrMapping(const MachineInstr &MI) const {
10421015
// type to i32 in applyMappingImpl.
10431016
LLT Ty = MRI.getType(MI.getOperand(2).getReg());
10441017
if (Ty.getSizeInBits() == 8 || Ty.getSizeInBits() == 16)
1045-
// Calls applyMappingImpl()
1046-
MappingID = CustomMappingID;
1018+
MappingID = 1;
10471019
OpRegBankIdx[2] = PMI_FirstGPR;
10481020
}
10491021

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16207,18 +16207,10 @@ static SDValue performCONCAT_VECTORSCombine(SDNode *N, SelectionDAG &DAG,
1620716207
if (MustNegateStride)
1620816208
Stride = DAG.getNegative(Stride, DL, Stride.getValueType());
1620916209

16210-
SDVTList VTs = DAG.getVTList({WideVecVT, MVT::Other});
16211-
SDValue IntID =
16212-
DAG.getTargetConstant(Intrinsic::riscv_masked_strided_load, DL,
16213-
Subtarget.getXLenVT());
16214-
1621516210
SDValue AllOneMask =
1621616211
DAG.getSplat(WideVecVT.changeVectorElementType(MVT::i1), DL,
1621716212
DAG.getConstant(1, DL, MVT::i1));
1621816213

16219-
SDValue Ops[] = {BaseLd->getChain(), IntID, DAG.getUNDEF(WideVecVT),
16220-
BaseLd->getBasePtr(), Stride, AllOneMask};
16221-
1622216214
uint64_t MemSize;
1622316215
if (auto *ConstStride = dyn_cast<ConstantSDNode>(Stride);
1622416216
ConstStride && ConstStride->getSExtValue() >= 0)
@@ -16234,8 +16226,11 @@ static SDValue performCONCAT_VECTORSCombine(SDNode *N, SelectionDAG &DAG,
1623416226
BaseLd->getPointerInfo(), BaseLd->getMemOperand()->getFlags(), MemSize,
1623516227
Align);
1623616228

16237-
SDValue StridedLoad = DAG.getMemIntrinsicNode(ISD::INTRINSIC_W_CHAIN, DL, VTs,
16238-
Ops, WideVecVT, MMO);
16229+
SDValue StridedLoad = DAG.getStridedLoadVP(
16230+
WideVecVT, DL, BaseLd->getChain(), BaseLd->getBasePtr(), Stride,
16231+
AllOneMask,
16232+
DAG.getConstant(N->getNumOperands(), DL, Subtarget.getXLenVT()), MMO);
16233+
1623916234
for (SDValue Ld : N->ops())
1624016235
DAG.makeEquivalentMemoryOrdering(cast<LoadSDNode>(Ld), StridedLoad);
1624116236

llvm/lib/Target/X86/MCTargetDesc/X86EncodingOptimization.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,8 @@ static bool optimizeToShortImmediateForm(MCInst &MI) {
481481
return false;
482482
#include "X86EncodingOptimizationForImmediate.def"
483483
}
484-
MCOperand &LastOp = MI.getOperand(MI.getNumOperands() - 1);
484+
unsigned SkipOperands = X86::isCCMPCC(MI.getOpcode()) ? 2 : 0;
485+
MCOperand &LastOp = MI.getOperand(MI.getNumOperands() - 1 - SkipOperands);
485486
if (LastOp.isExpr()) {
486487
const MCSymbolRefExpr *SRE = dyn_cast<MCSymbolRefExpr>(LastOp.getExpr());
487488
if (!SRE || SRE->getKind() != MCSymbolRefExpr::VK_X86_ABS8)

0 commit comments

Comments
 (0)