14 Commits

Author SHA1 Message Date
Jeremy Morse
749443a307
[NFC][DebugInfo] Mop up final instruction-insertion call sites (#124289)
These are the final places in the monorepo that make use of instruction
insertion for methods like insertBefore and moveBefore. As part of the
RemoveDIs project, instead use iterators for insertion. (see:
https://discourse.llvm.org/t/rfc-instruction-api-changes-needed-to-eliminate-debug-intrinsics-from-ir/68939
).
2025-01-27 16:07:27 +00:00
vporpo
22d4ff155a
[SandboxIR] Fix CmpInst::create() when it gets folded (#123408)
If the operands of a CmpInst are constants then it gets folded into a
constant. Therefore CmpInst::create() should return a Value*, not a
Constant* and should handle the creation of the constant correctly.
2025-01-17 14:37:29 -08:00
Jorge Gorbe Moya
9d85ba5724
[SandboxIR] Preserve the order of switch cases after revert. (#115577)
Preserving the case order is not strictly necessary to preserve
semantics (for example, operations like SwitchInst::removeCase will
happily swap cases around). However, I'm planning to introduce an
optional verification step for SandboxIR that will use StructuralHash to
compare IR after a revert to the original IR to help catch tracker bugs,
and the order difference triggers a difference there.
2024-11-12 14:10:46 -08:00
Jorge Gorbe Moya
7a6a52a2f0
[SandboxIR] Remove incorrect assertion. (#115553)
`insertBefore` can be called on a detached instruction, and we can't
check that the underlying instructions are ordered because instructions
without BB parents have no order.

This problem showed up as a different assertion failure in
`llvm::Instruction::comesBefore` in one of the unit tests when
`EXPENSIVE_CHECKS` are enabled.
2024-11-08 14:14:28 -08:00
Jorge Gorbe Moya
4df71ab78e
[SandboxIR] Add callbacks for instruction insert/remove/move ops (#112965) 2024-10-29 09:25:51 -07:00
vporpo
ed5088a271
[SandboxIR] Switch more Instruction::create() to InsertPosition (#111213)
Also moves CmpInst definitions from Context.cpp to Instruction.cpp
2024-10-04 15:06:55 -07:00
vporpo
c029702f82
[SandboxIR] Switch more Instruction::create() to InsertPosition (#111208) 2024-10-04 14:26:22 -07:00
vporpo
4f3a0959d6
[SandboxIR] Switch more Instruction::create() to InsertPosition (#111187) 2024-10-04 13:30:53 -07:00
vporpo
3a47bf633c
[SandboxIR] Switch more Instruction::create() to InsertPosition (#111080) 2024-10-04 10:54:20 -07:00
vporpo
e1434a8764
[SandboxIR] Switch more Instruction::create() functions to InsertPosition (#111075) 2024-10-03 17:47:36 -07:00
vporpo
635db5ee97
[SandboxIR] Implement InsertPosition (#110730)
This patch implements the InsertPosition class that is used to specify
where an instruction should be placed.

It also switches a couple of create() functions from the old API to the
new one that uses InsertPosition.
2024-10-03 16:23:23 -07:00
vporpo
9e85937b83
[SandboxIR][NFC] Rename SandboxIRValues.def to Values.def (#110538) 2024-09-30 11:24:55 -07:00
vporpo
e22b07e766
[SandboxIR][NFC] Move Function class to a separate file (#110526) 2024-09-30 10:12:47 -07:00
vporpo
eba106d461
[SandboxIR][NFC] Move Instruction classes into a separate file (#110294) 2024-09-27 10:54:11 -07:00