aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineInstr.cpp
diff options
context:
space:
mode:
authorThorsten Schütt <schuett@gmail.com>2024-06-14 20:56:43 +0200
committerGitHub <noreply@github.com>2024-06-14 20:56:43 +0200
commitb1f9440fa9286638bb1fe72a14d220770d1987cc (patch)
treeb23fa7fe6e35e4721946b57160a18ce82858aaa4 /llvm/lib/CodeGen/MachineInstr.cpp
parent2ecb1ab6d701b6b4ec451f2c402c80c9fb9dcb14 (diff)
downloadllvm-b1f9440fa9286638bb1fe72a14d220770d1987cc.zip
llvm-b1f9440fa9286638bb1fe72a14d220770d1987cc.tar.gz
llvm-b1f9440fa9286638bb1fe72a14d220770d1987cc.tar.bz2
[GlobalIsel] Import GEP flags (#93850)
https://github.com/llvm/llvm-project/pull/90824
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineInstr.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp
index 02479f3..198af93 100644
--- a/llvm/lib/CodeGen/MachineInstr.cpp
+++ b/llvm/lib/CodeGen/MachineInstr.cpp
@@ -576,6 +576,11 @@ uint32_t MachineInstr::copyFlagsFromInstruction(const Instruction &I) {
MIFlags |= MachineInstr::MIFlag::NoSWrap;
if (TI->hasNoUnsignedWrap())
MIFlags |= MachineInstr::MIFlag::NoUWrap;
+ } else if (const GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(&I)) {
+ if (GEP->hasNoUnsignedSignedWrap())
+ MIFlags |= MachineInstr::MIFlag::NoUSWrap;
+ if (GEP->hasNoUnsignedWrap())
+ MIFlags |= MachineInstr::MIFlag::NoUWrap;
}
// Copy the nonneg flag.