Skip to content

Merge 19.1.6 into emscripten-libs-19 #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 39 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
51dee6b
Bump version to 19.1.5
tru Nov 19, 2024
02930b8
[NVPTX] Promote v2i8 to v2i16 (#111189)
manasij7479 Oct 4, 2024
e032d7a
[clang-repl] Improve flags responsible for generating shared wasm bin…
anutosh491 Nov 19, 2024
fb6b195
[compiler-rt] [test] Remove an unintended grep parameter
mstorsjo Oct 20, 2024
ea96040
[Mips] Change vsplat_imm_eq_1 to a ComplexPattern. (#116471)
topperc Nov 17, 2024
3d12f45
[SDAG][ISel][TableGen][LoongArch] Report error for trivial bitcasts w…
dtcxzyw Nov 19, 2024
f9ae37c
[InstCombine] Handle constant GEP expr in `SimplifyDemandedUseBits` (…
dtcxzyw Nov 19, 2024
e80925b
[lld][Hexagon] Fix R_HEX_B22_PCREL range checks (#115925)
quic-akaryaki Nov 19, 2024
5bd0474
[LICM] allow MemoryAccess creation failure (#116813)
dianqk Nov 20, 2024
336f877
[LoongArch] Fix GOT usage for `non-dso_local` function calls in large…
wangleiat Nov 21, 2024
11be11b
[SCEV] Fix sext handling for `getConstantMultiple` (#117093)
dtcxzyw Nov 21, 2024
7e2da7d
[ConstraintElim] Bail out on non-dedicated exits when adding exiting …
dtcxzyw Nov 18, 2024
32cbe24
[MachineLICM] Add test case showing load hoisted across memory barrier.
fhahn Nov 20, 2024
086d8e6
[MachineLICM] Don't allow hoisting invariant loads across mem barrier…
fhahn Nov 21, 2024
0e7e5d9
[InstCombine] Drop noundef attributes in `foldCttzCtlz` (#116718)
dtcxzyw Nov 19, 2024
edded5a
[SLP][NFC]Add a test with the incorrect casting of the abs argument, NFC
alexey-bataev Oct 18, 2024
9f72c98
[SLP]Check that operand of abs does not overflow before making it par…
alexey-bataev Oct 18, 2024
dc665fa
[MC][LoongArch] Change default cpu in `MCSubtargetInfo`. (#114922)
ylzsx Nov 11, 2024
f64f76f
Bail out jump threading on indirect branches (#103688)
hiraditya Sep 11, 2024
321f0dd
Bail out jump threading on indirect branches only (#117778)
hiraditya Nov 26, 2024
e6bcdea
[clang-repl] Fix generation of wasm binaries while running clang-repl…
anutosh491 Nov 29, 2024
cf55b9c
[AArch64][Darwin][SME] Don't try to save VG to the stack for unwinding.
aemerson Aug 13, 2024
4716c47
[AArch64][SME] Return false from produceCompactUnwindFrame if VG save…
kmclaughlin-arm Aug 19, 2024
876d050
[AArch64][SME] Fix iterator to fixupCalleeSaveRestoreStackOffset (#11…
sdesmalen-arm Oct 15, 2024
ab4b5a2
[clang] recognize hexagon-*-ld.lld variants (#117338)
androm3da Nov 29, 2024
c9e72b3
Bump version to 19.1.6
tru Dec 13, 2024
3d21a9a
[Clang][perf-training] Fix clean command in perf-helper.py (#118978)
tstellar Dec 7, 2024
d2953ab
[lld][WebAssembly] Fix use of uninitialized stack data with --wasm64 …
sbc100 Sep 9, 2024
be6e2e7
[offload] - Fix issue with standalone debug offload build (#104647)
estewart08 Aug 19, 2024
e3b2d01
[offload] Include CheckCXXCompilerFlag in CMake
mgorny Nov 30, 2024
5ce79b5
[offload] [test] Add "omp" test dependency only when present
mgorny Nov 30, 2024
909104b
[offload] Define OPENMP_TEST*_FLAGS in standalone builds
mgorny Nov 30, 2024
b70bf59
[offload] Define LIBOMPTARGET_OPENMP_*_FOLDER in standalone builds
mgorny Nov 30, 2024
2384a06
[cmake] Use DetectTestCompiler from openmp directory
mgorny Dec 1, 2024
8069ce6
[WebAssembly] Support multiple `.init_array` fragments when writing W…
georgestagg Dec 4, 2024
8e9465b
[WebAssembly] Handle symbols in `.init_array` sections (#119127)
georgestagg Dec 10, 2024
657e03f
[AggressiveInstCombine] Use APInt and avoid truncation when folding l…
antoniofrighetto Dec 4, 2024
e21dc4b
[SimpleLoopUnswitch] Fix LCSSA phi node invalidation
nikic Nov 27, 2024
4c2a6ab
Merge 19.1.6 into emscripten-libs-19
aheejin Jan 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions clang/lib/Driver/ToolChains/Hexagon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,10 @@ constructHexagonLinkArgs(Compilation &C, const JobAction &JA,
bool IncStartFiles = !Args.hasArg(options::OPT_nostartfiles);
bool IncDefLibs = !Args.hasArg(options::OPT_nodefaultlibs);
bool UseG0 = false;
const char *Exec = Args.MakeArgString(HTC.GetLinkerPath());
bool UseLLD = (llvm::sys::path::filename(Exec).equals_insensitive("ld.lld") ||
llvm::sys::path::stem(Exec).equals_insensitive("ld.lld"));
bool UseLLD = false;
const char *Exec = Args.MakeArgString(HTC.GetLinkerPath(&UseLLD));
UseLLD = UseLLD || llvm::sys::path::filename(Exec).ends_with("ld.lld") ||
llvm::sys::path::stem(Exec).ends_with("ld.lld");
bool UseShared = IsShared && !IsStatic;
StringRef CpuVer = toolchains::HexagonToolChain::GetTargetCPUVersion(Args);

Expand Down
2 changes: 2 additions & 0 deletions clang/lib/Interpreter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ set(LLVM_LINK_COMPONENTS
if (EMSCRIPTEN AND "lld" IN_LIST LLVM_ENABLE_PROJECTS)
set(WASM_SRC Wasm.cpp)
set(WASM_LINK lldWasm)
set(COMMON_LINK lldCommon)
endif()

add_clang_library(clangInterpreter
Expand Down Expand Up @@ -45,6 +46,7 @@ add_clang_library(clangInterpreter
clangSema
clangSerialization
${WASM_LINK}
${COMMON_LINK}
)

if ((MINGW OR CYGWIN) AND BUILD_SHARED_LIBS)
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/Interpreter/IncrementalExecutor.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class IncrementalExecutor {
virtual llvm::Error addModule(PartialTranslationUnit &PTU);
virtual llvm::Error removeModule(PartialTranslationUnit &PTU);
virtual llvm::Error runCtors() const;
llvm::Error cleanUp();
virtual llvm::Error cleanUp();
llvm::Expected<llvm::orc::ExecutorAddr>
getSymbolAddress(llvm::StringRef Name, SymbolNameKind NameKind) const;

Expand Down
2 changes: 1 addition & 1 deletion clang/lib/Interpreter/Interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ IncrementalCompilerBuilder::CreateCpp() {
#ifdef __EMSCRIPTEN__
Argv.push_back("-target");
Argv.push_back("wasm32-unknown-emscripten");
Argv.push_back("-pie");
Argv.push_back("-shared");
Argv.push_back("-fvisibility=default");
#endif
Argv.insert(Argv.end(), UserArgs.begin(), UserArgs.end());

Expand Down
65 changes: 50 additions & 15 deletions clang/lib/Interpreter/Wasm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,31 @@
#include <string>

namespace lld {
enum Flavor {
Invalid,
Gnu, // -flavor gnu
MinGW, // -flavor gnu MinGW
WinLink, // -flavor link
Darwin, // -flavor darwin
Wasm, // -flavor wasm
};

using Driver = bool (*)(llvm::ArrayRef<const char *>, llvm::raw_ostream &,
llvm::raw_ostream &, bool, bool);

struct DriverDef {
Flavor f;
Driver d;
};

struct Result {
int retCode;
bool canRunAgain;
};

Result lldMain(llvm::ArrayRef<const char *> args, llvm::raw_ostream &stdoutOS,
llvm::raw_ostream &stderrOS, llvm::ArrayRef<DriverDef> drivers);

namespace wasm {
bool link(llvm::ArrayRef<const char *> args, llvm::raw_ostream &stdoutOS,
llvm::raw_ostream &stderrOS, bool exitEarly, bool disableOutput);
Expand Down Expand Up @@ -51,13 +76,14 @@ llvm::Error WasmIncrementalExecutor::addModule(PartialTranslationUnit &PTU) {
llvm::TargetMachine *TargetMachine = Target->createTargetMachine(
PTU.TheModule->getTargetTriple(), "", "", TO, llvm::Reloc::Model::PIC_);
PTU.TheModule->setDataLayout(TargetMachine->createDataLayout());
std::string OutputFileName = PTU.TheModule->getName().str() + ".wasm";
std::string ObjectFileName = PTU.TheModule->getName().str() + ".o";
std::string BinaryFileName = PTU.TheModule->getName().str() + ".wasm";

std::error_code Error;
llvm::raw_fd_ostream OutputFile(llvm::StringRef(OutputFileName), Error);
llvm::raw_fd_ostream ObjectFileOutput(llvm::StringRef(ObjectFileName), Error);

llvm::legacy::PassManager PM;
if (TargetMachine->addPassesToEmitFile(PM, OutputFile, nullptr,
if (TargetMachine->addPassesToEmitFile(PM, ObjectFileOutput, nullptr,
llvm::CodeGenFileType::ObjectFile)) {
return llvm::make_error<llvm::StringError>(
"Wasm backend cannot produce object.", llvm::inconvertibleErrorCode());
Expand All @@ -69,27 +95,30 @@ llvm::Error WasmIncrementalExecutor::addModule(PartialTranslationUnit &PTU) {
llvm::inconvertibleErrorCode());
}

OutputFile.close();
ObjectFileOutput.close();

std::vector<const char *> LinkerArgs = {"wasm-ld",
"-pie",
"-shared",
"--import-memory",
"--no-entry",
"--export-all",
"--experimental-pic",
"--no-export-dynamic",
"--stack-first",
OutputFileName.c_str(),
"--allow-undefined",
ObjectFileName.c_str(),
"-o",
OutputFileName.c_str()};
int Result =
lld::wasm::link(LinkerArgs, llvm::outs(), llvm::errs(), false, false);
if (!Result)
BinaryFileName.c_str()};

const lld::DriverDef WasmDriver = {lld::Flavor::Wasm, &lld::wasm::link};
std::vector<lld::DriverDef> WasmDriverArgs;
WasmDriverArgs.push_back(WasmDriver);
lld::Result Result =
lld::lldMain(LinkerArgs, llvm::outs(), llvm::errs(), WasmDriverArgs);

if (Result.retCode)
return llvm::make_error<llvm::StringError>(
"Failed to link incremental module", llvm::inconvertibleErrorCode());

void *LoadedLibModule =
dlopen(OutputFileName.c_str(), RTLD_NOW | RTLD_GLOBAL);
dlopen(BinaryFileName.c_str(), RTLD_NOW | RTLD_GLOBAL);
if (LoadedLibModule == nullptr) {
llvm::errs() << dlerror() << '\n';
return llvm::make_error<llvm::StringError>(
Expand All @@ -109,6 +138,12 @@ llvm::Error WasmIncrementalExecutor::runCtors() const {
return llvm::Error::success();
}

llvm::Error WasmIncrementalExecutor::cleanUp() {
// Can't call cleanUp through IncrementalExecutor as it
// tries to deinitialize JIT which hasn't been initialized
return llvm::Error::success();
}

WasmIncrementalExecutor::~WasmIncrementalExecutor() = default;

} // namespace clang
} // namespace clang
1 change: 1 addition & 0 deletions clang/lib/Interpreter/Wasm.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class WasmIncrementalExecutor : public IncrementalExecutor {
llvm::Error addModule(PartialTranslationUnit &PTU) override;
llvm::Error removeModule(PartialTranslationUnit &PTU) override;
llvm::Error runCtors() const override;
llvm::Error cleanUp() override;

~WasmIncrementalExecutor() override;
};
Expand Down
2 changes: 1 addition & 1 deletion clang/utils/perf-training/perf-helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def clean(args):
+ "\tRemoves all files with extension from <path>."
)
return 1
for path in args[1:-1]:
for path in args[0:-1]:
for filename in findFilesWithExtension(path, args[-1]):
os.remove(filename)
return 0
Expand Down
2 changes: 1 addition & 1 deletion cmake/Modules/LLVMVersion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if(NOT DEFINED LLVM_VERSION_MINOR)
set(LLVM_VERSION_MINOR 1)
endif()
if(NOT DEFINED LLVM_VERSION_PATCH)
set(LLVM_VERSION_PATCH 4)
set(LLVM_VERSION_PATCH 6)
endif()
if(NOT DEFINED LLVM_VERSION_SUFFIX)
set(LLVM_VERSION_SUFFIX)
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/test/asan/TestCases/Windows/delay_dbghelp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// static build, there won't be any clang_rt DLLs.
// RUN: not grep cl""ang_rt %t || \
// RUN: grep cl""ang_rt %t | xargs which | \
// RUN: xargs llvm-readobj --coff-imports | not grep dbghelp.dll %t
// RUN: xargs llvm-readobj --coff-imports | not grep dbghelp.dll

extern "C" int puts(const char *);

Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__config
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// _LIBCPP_VERSION represents the version of libc++, which matches the version of LLVM.
// Given a LLVM release LLVM XX.YY.ZZ (e.g. LLVM 17.0.1 == 17.00.01), _LIBCPP_VERSION is
// defined to XXYYZZ.
# define _LIBCPP_VERSION 190104
# define _LIBCPP_VERSION 190106

# define _LIBCPP_CONCAT_IMPL(_X, _Y) _X##_Y
# define _LIBCPP_CONCAT(_X, _Y) _LIBCPP_CONCAT_IMPL(_X, _Y)
Expand Down
2 changes: 1 addition & 1 deletion lld/ELF/Arch/Hexagon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ void Hexagon::relocate(uint8_t *loc, const Relocation &rel,
case R_HEX_B22_PCREL:
case R_HEX_GD_PLT_B22_PCREL:
case R_HEX_PLT_B22_PCREL:
checkInt(loc, val, 22, rel);
checkInt(loc, val, 24, rel);
or32le(loc, applyMask(0x1ff3ffe, val >> 2));
break;
case R_HEX_B22_PCREL_X:
Expand Down
2 changes: 1 addition & 1 deletion lld/test/ELF/emulation-loongarch.s
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
# LA32-NEXT: StringTableSectionIndex:
# LA32-NEXT: }

# RUN: llvm-mc -filetype=obj -triple=loongarch64 %s -o %t.o
# RUN: llvm-mc -filetype=obj -triple=loongarch64 -mattr=+d %s -o %t.o
# RUN: ld.lld %t.o -o %t
# RUN: llvm-readobj --file-headers %t | FileCheck --check-prefix=LA64 %s
# RUN: ld.lld -m elf64loongarch %t.o -o %t
Expand Down
2 changes: 1 addition & 1 deletion lld/test/ELF/hexagon-jump-error.s
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if (p0) jump #1f
.section b15, "ax"
1:

# CHECK: relocation R_HEX_B22_PCREL out of range: 8388612 is not in [-2097152, 2097151]
# CHECK: relocation R_HEX_B22_PCREL out of range: 8388612 is not in [-8388608, 8388607]
jump #1f
.space (1<<23)
.section b22, "ax"
Expand Down
41 changes: 40 additions & 1 deletion lld/test/ELF/hexagon.s
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# REQUIRES: hexagon
# RUN: llvm-mc -filetype=obj -triple=hexagon-unknown-elf %s -o %t.o
# RUN: llvm-mc -filetype=obj -triple=hexagon-unknown-elf %S/Inputs/hexagon.s -o %t1.o
# RUN: ld.lld %t.o %t1.o -o %t
# RUN: ld.lld %t.o %t1.o -o %t --Ttext=0x200b4 --section-start=b_1000000=0x1000000 \
# RUN: --section-start=b_1000400=0x1000400 --section-start=b_1004000=0x1004000 \
# RUN: --section-start=b_1010000=0x1010000 --section-start=b_1800000=0x1800000
# RUN: llvm-objdump --no-print-imm-hex -d %t | FileCheck %s

# Note: 131584 == 0x20200
Expand Down Expand Up @@ -221,3 +223,40 @@ r0 = memw(r1+##_start)

memw(r0+##_start) = r1
# CHECK: memw(r0+##131644) = r1


## Tests for maximum branch ranges reachable without trampolines.

.section b_1000000, "ax"
## The nop makes sure the first jump is within range.
nop
{ r0 = #0; jump #b_1000400 } // R_HEX_B9_PCREL
if (r0==#0) jump:t #b_1004000 // R_HEX_B13_PCREL
if (p0) jump #b_1010000 // R_HEX_B15_PCREL
jump #b_1800000 // R_HEX_B22_PCREL

.section b_1000400, "ax"
nop

.section b_1004000, "ax"
nop

.section b_1010000, "ax"
nop

.section b_1800000, "ax"
nop

## Make sure we got the right relocations.
# RUN: llvm-readelf -r %t.o | FileCheck %s --check-prefix=REL
# REL: R_HEX_B9_PCREL 00000000 b_1000400
# REL: R_HEX_B13_PCREL 00000000 b_1004000
# REL: R_HEX_B15_PCREL 00000000 b_1010000
# REL: R_HEX_B22_PCREL 00000000 b_1800000

# CHECK: 01000000 <b_1000000>:
# CHECK-NEXT: 1000000: {{.*}} { nop }
# CHECK-NEXT: 1000004: {{.*}} { r0 = #0 ; jump 0x1000400 }
# CHECK-NEXT: 1000008: {{.*}} { if (r0==#0) jump:t 0x1004000 }
# CHECK-NEXT: 100000c: {{.*}} { if (p0) jump:nt 0x1010000 }
# CHECK-NEXT: 1000010: {{.*}} { jump 0x1800000 }
4 changes: 2 additions & 2 deletions lld/test/ELF/loongarch-interlink.test
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

# RUN: yaml2obj %t/blob.yaml -o %t/blob.o
# RUN: yaml2obj %t/v0-lp64d.yaml -o %t/v0-lp64d.o
# RUN: llvm-mc --filetype=obj --triple=loongarch64-unknown-gnu %t/start.s -o %t/v1-lp64d.o
# RUN: llvm-mc --filetype=obj --triple=loongarch64-unknown-gnu --mattr=+d %t/start.s -o %t/v1-lp64d.o
# RUN: llvm-mc --filetype=obj --triple=loongarch64-unknown-gnusf %t/start.s -o %t/v1-lp64s.o
# RUN: llvm-mc --filetype=obj --triple=loongarch64-unknown-gnu %t/bar.s -o %t/v1-b-lp64d.o
# RUN: llvm-mc --filetype=obj --triple=loongarch64-unknown-gnu --mattr=+d %t/bar.s -o %t/v1-b-lp64d.o

## Check that binary input results in e_flags=0 output.
# RUN: ld.lld -m elf64loongarch -b binary %t/blob.bin -o %t/blob.out
Expand Down
3 changes: 1 addition & 2 deletions lld/wasm/SyntheticSections.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -587,8 +587,7 @@ void ElemSection::writeBody() {
initExpr.Inst.Value.Global = WasmSym::tableBase->getGlobalIndex();
} else {
bool is64 = config->is64.value_or(false);
initExpr.Inst.Opcode = is64 ? WASM_OPCODE_I64_CONST : WASM_OPCODE_I32_CONST;
initExpr.Inst.Value.Int32 = config->tableBase;
initExpr = intConst(config->tableBase, is64);
}
writeInitExpr(os, initExpr);

Expand Down
5 changes: 5 additions & 0 deletions llvm/include/llvm/Analysis/MemorySSAUpdater.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,11 @@ class MemorySSAUpdater {
const BasicBlock *BB,
MemorySSA::InsertionPlace Point);

MemoryAccess *createMemoryAccessInBB(Instruction *I, MemoryAccess *Definition,
const BasicBlock *BB,
MemorySSA::InsertionPlace Point,
bool CreationMustSucceed);

/// Create a MemoryAccess in MemorySSA before an existing MemoryAccess.
///
/// See createMemoryAccessInBB() for usage details.
Expand Down
13 changes: 11 additions & 2 deletions llvm/lib/Analysis/MemorySSAUpdater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1404,8 +1404,17 @@ void MemorySSAUpdater::changeToUnreachable(const Instruction *I) {
MemoryAccess *MemorySSAUpdater::createMemoryAccessInBB(
Instruction *I, MemoryAccess *Definition, const BasicBlock *BB,
MemorySSA::InsertionPlace Point) {
MemoryUseOrDef *NewAccess = MSSA->createDefinedAccess(I, Definition);
MSSA->insertIntoListsForBlock(NewAccess, BB, Point);
return createMemoryAccessInBB(I, Definition, BB, Point,
/*CreationMustSucceed=*/true);
}

MemoryAccess *MemorySSAUpdater::createMemoryAccessInBB(
Instruction *I, MemoryAccess *Definition, const BasicBlock *BB,
MemorySSA::InsertionPlace Point, bool CreationMustSucceed) {
MemoryUseOrDef *NewAccess = MSSA->createDefinedAccess(
I, Definition, /*Template=*/nullptr, CreationMustSucceed);
if (NewAccess)
MSSA->insertIntoListsForBlock(NewAccess, BB, Point);
return NewAccess;
}

Expand Down
4 changes: 3 additions & 1 deletion llvm/lib/Analysis/ScalarEvolution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6313,8 +6313,10 @@ APInt ScalarEvolution::getConstantMultipleImpl(const SCEV *S) {
return getConstantMultiple(Z->getOperand()).zext(BitWidth);
}
case scSignExtend: {
// Only multiples that are a power of 2 will hold after sext.
const SCEVSignExtendExpr *E = cast<SCEVSignExtendExpr>(S);
return getConstantMultiple(E->getOperand()).sext(BitWidth);
uint32_t TZ = getMinTrailingZeros(E->getOperand());
return GetShiftedByZeros(TZ);
}
case scMulExpr: {
const SCEVMulExpr *M = cast<SCEVMulExpr>(S);
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/MachineLICM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1474,7 +1474,7 @@ void MachineLICMBase::InitializeLoadsHoistableLoops() {
if (!AllowedToHoistLoads[Loop])
continue;
for (auto &MI : *MBB) {
if (!MI.mayStore() && !MI.isCall() &&
if (!MI.isLoadFoldBarrier() && !MI.mayStore() && !MI.isCall() &&
!(MI.mayLoad() && MI.hasOrderedMemoryRef()))
continue;
for (MachineLoop *L = Loop; L != nullptr; L = L->getParentLoop())
Expand Down
Loading
Loading