Skip to content

Commit

Permalink
[Hexagon] Do not insert instructions before PHI nodes
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297141 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
Krzysztof Parzyszek committed Mar 7, 2017
1 parent f33a699 commit c1af14f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/Target/Hexagon/HexagonBitSimplify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2375,7 +2375,9 @@ bool BitSimplification::simplifyExtractLow(MachineInstr *MI,
DebugLoc DL = MI->getDebugLoc();
MachineBasicBlock &B = *MI->getParent();
unsigned NewR = MRI.createVirtualRegister(FRC);
auto MIB = BuildMI(B, MI, DL, HII.get(ExtOpc), NewR)
auto At = MI->isPHI() ? B.getFirstNonPHI()
: MachineBasicBlock::iterator(MI);
auto MIB = BuildMI(B, At, DL, HII.get(ExtOpc), NewR)
.addReg(R, 0, SR);
switch (ExtOpc) {
case Hexagon::A2_sxtb:
Expand Down
1 change: 1 addition & 0 deletions test/CodeGen/Hexagon/bit-phi.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: llc -march=hexagon < %s
; RUN: llc -march=hexagon -disable-hcp < %s
; REQUIRES: asserts

target datalayout = "e-m:e-p:32:32-i1:32-i64:64-a:0-v32:32-n16:32"
Expand Down

0 comments on commit c1af14f

Please sign in to comment.