[llvm] r348620 - [X86] Initialize and Register X86CondBrFoldingPass
Jordan Rupprecht via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 7 13:46:58 PST 2018
Looks like this newly added test is failing in certain configurations.
Internally we see it pass in vanilla mode but fail in opt, and I see some
public buildbots are broken:
http://lab.llvm.org:8011/builders/lldb-amd64-ninja-netbsd8/builds/17493
http://lab.llvm.org:8011/builders/clang-with-lto-ubuntu/builds/11432
I haven't yet figured out which CMake are relevant for repro though. Mind
taking a look?
On Fri, Dec 7, 2018 at 10:13 AM Craig Topper via llvm-commits <
llvm-commits at lists.llvm.org> wrote:
> Author: ctopper
> Date: Fri Dec 7 10:10:34 2018
> New Revision: 348620
>
> URL: http://llvm.org/viewvc/llvm-project?rev=348620&view=rev
> Log:
> [X86] Initialize and Register X86CondBrFoldingPass
>
> To make X86CondBrFoldingPass can be run with --run-pass option, this can
> test one wrong assertion on analyzeCompare function for SUB32ri when its
> operand is not imm
>
> Patch by Jianping Chen
>
> Differential Revision: https://reviews.llvm.org/D55412
>
> Added:
> llvm/trunk/test/CodeGen/X86/test_x86condbr_globaladdr.mir
> Modified:
> llvm/trunk/lib/Target/X86/X86.h
> llvm/trunk/lib/Target/X86/X86CondBrFolding.cpp
> llvm/trunk/lib/Target/X86/X86TargetMachine.cpp
>
> Modified: llvm/trunk/lib/Target/X86/X86.h
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86.h?rev=348620&r1=348619&r2=348620&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/Target/X86/X86.h (original)
> +++ llvm/trunk/lib/Target/X86/X86.h Fri Dec 7 10:10:34 2018
> @@ -143,6 +143,7 @@ void initializeWinEHStatePassPass(PassRe
> void initializeX86AvoidSFBPassPass(PassRegistry &);
> void initializeX86CallFrameOptimizationPass(PassRegistry &);
> void initializeX86CmovConverterPassPass(PassRegistry &);
> +void initializeX86CondBrFoldingPassPass(PassRegistry &);
> void initializeX86DomainReassignmentPass(PassRegistry &);
> void initializeX86ExecutionDomainFixPass(PassRegistry &);
> void initializeX86FlagsCopyLoweringPassPass(PassRegistry &);
>
> Modified: llvm/trunk/lib/Target/X86/X86CondBrFolding.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86CondBrFolding.cpp?rev=348620&r1=348619&r2=348620&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/Target/X86/X86CondBrFolding.cpp (original)
> +++ llvm/trunk/lib/Target/X86/X86CondBrFolding.cpp Fri Dec 7 10:10:34 2018
> @@ -62,8 +62,9 @@ STATISTIC(NumFixedCondBrs, "Number of x8
> namespace {
> class X86CondBrFoldingPass : public MachineFunctionPass {
> public:
> - X86CondBrFoldingPass() : MachineFunctionPass(ID) {}
> -
> + X86CondBrFoldingPass() : MachineFunctionPass(ID) {
> + initializeX86CondBrFoldingPassPass(*PassRegistry::getPassRegistry());
> + }
> StringRef getPassName() const override { return "X86 CondBr Folding"; }
>
> bool runOnMachineFunction(MachineFunction &MF) override;
> @@ -73,12 +74,13 @@ public:
> AU.addRequired<MachineBranchProbabilityInfo>();
> }
>
> -private:
> +public:
> static char ID;
> };
> +} // namespace
>
> char X86CondBrFoldingPass::ID = 0;
> -} // namespace
> +INITIALIZE_PASS(X86CondBrFoldingPass, "X86CondBrFolding",
> "X86CondBrFolding", false, false)
>
> FunctionPass *llvm::createX86CondBrFolding() {
> return new X86CondBrFoldingPass();
>
> Modified: llvm/trunk/lib/Target/X86/X86TargetMachine.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetMachine.cpp?rev=348620&r1=348619&r2=348620&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/Target/X86/X86TargetMachine.cpp (original)
> +++ llvm/trunk/lib/Target/X86/X86TargetMachine.cpp Fri Dec 7 10:10:34 2018
> @@ -78,6 +78,7 @@ extern "C" void LLVMInitializeX86Target(
> initializeX86AvoidSFBPassPass(PR);
> initializeX86SpeculativeLoadHardeningPassPass(PR);
> initializeX86FlagsCopyLoweringPassPass(PR);
> + initializeX86CondBrFoldingPassPass(PR);
> }
>
> static std::unique_ptr<TargetLoweringObjectFile> createTLOF(const Triple
> &TT) {
>
> Added: llvm/trunk/test/CodeGen/X86/test_x86condbr_globaladdr.mir
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/test_x86condbr_globaladdr.mir?rev=348620&view=auto
>
> ==============================================================================
> --- llvm/trunk/test/CodeGen/X86/test_x86condbr_globaladdr.mir (added)
> +++ llvm/trunk/test/CodeGen/X86/test_x86condbr_globaladdr.mir Fri Dec 7
> 10:10:34 2018
> @@ -0,0 +1,30 @@
> +# XFAIL: *
> +# RUN: llc -o - %s -mtriple=i686-- -mcpu=ivybridge --run-pass
> X86CondBrFolding | FileCheck %s
> +# Test wrong assertion when meet SUB32ri with global address
> +# in X86CondBrFoldingiPass
> +--- |
> + @img2buf_normal = external global i32
> + define void @func() { ret void }
> +...
> +---
> +# CHECK: bb.0:
> +# CHECK: %2:gr32 = SUB32ri %1, @img2buf_normal, implicit-def $eflags
> +
> +name: func
> +tracksRegLiveness: true
> +body: |
> + bb.0:
> + liveins: $edx
> + %1:gr32 = COPY $edx
> + %2:gr32 = MOV32rm %1:gr32, 1, $noreg, 850256, $noreg
> + %3:gr32 = SUB32ri %2:gr32, @img2buf_normal, implicit-def $eflags
> + JE_1 %bb.2, implicit $eflags
> + JMP_1 %bb.3
> +
> + bb.2:
> + RET 0, undef $eax
> +
> + bb.3:
> + $eax = MOV32rr %3:gr32
> + RET 0, $eax
> +...
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181207/8aeb1217/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4849 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181207/8aeb1217/attachment.bin>
More information about the llvm-commits
mailing list