[llvm] [GlobalIsel] Import GEP flags (PR #93850)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Thu May 30 11:52:32 PDT 2024
================
@@ -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::NoSWrap;
----------------
nikic wrote:
Yes, nusw and nsw are not the same thing. You *can* transfer nsw to the scale multiplication, but not to the PTRADD, as this PR appears to be doing.
https://github.com/llvm/llvm-project/pull/93850
More information about the llvm-commits
mailing list